import React from 'react'
import {inject, observer} from 'mobx-react'
import {toJS} from 'mobx'
import {WeaDialog, WeaNewScroll, WeaTools, WeaTop, WeaRightMenu,WeaMoreButton,WeaDatePicker ,WeaFormItem} from 'ecCom'
import {Button, Spin, Modal,message,Row, Col, Checkbox,Radio } from 'antd';
import moment from 'moment'
import Create from './create.js'
import Preview from './preview.js'
import DecisionDialog from './preview/decisionDialog/index.js'
import * as API_LIST from '../../apis/dialog.js'
import mapKeys from 'lodash/mapKeys'
import mapValues from 'lodash/mapValues'
import './index.less'
import * as meetingUtil from '../../util/index'
import {WeaLogView} from 'comsMobx';

const WeaLogViewComp = WeaLogView.Component;

const confirm = Modal.confirm;
const errorModal = Modal.warning;

import EndRepeatMeeting from '../../components/repeat/EndRepeatMeeting';
import {WeaLocaleProvider} from 'ecCom';

const getLabel = WeaLocaleProvider.getLabel;

const store = ['meetingDialog', 'meetingRepeat', 'meetingStoreMap', 'seatStore', 'seatCardStore']

@inject(...store)
@observer
class MeetingDialog extends React.Component {
  constructor(props) {
    super(props)
    this.state = {
      type: this.props.isSingle ? this.props.type : '',
      visible: false,
      test: '',
      createCondition: '',
      previewCondition: '',
      exchangeList: '',
      previewButtons: [],
      authConditions: [],
      authVisible: false,
      activeKey: '1',
      spinning: true,
      workPlanTypeOptions: '',
      showGroup: true,
      zIndex: 801,
      isRoomPlanState: true,
      logvisible: false,
      currentTime: 0,
    }
  }

  componentWillMount(){
    //作用:当只有一个流程的时候是要直接打开不弹出dialog的,这样就需要知悉流程参数并将值带出进行流程表单数据初始化
    let {getRequestParams} = this.props.meetingDialog;
    getRequestParams();
  }

  componentDidMount() {
    // 异步加载会议后端的静态资源
    if (!window.weaMeetingEngine) {
      eventRegister.loadModule('b_meeting', () => {
        // 加载成功
        setTimeout(() => {
          this.props.meetingDialog.setLoaded(true)
        }, 200)
      }, () => {
        // 加载文件失败 的业务处理， 网络超时，没文件之类
      })
    } else {
      this.props.meetingDialog.setLoaded(true)
    }
    //异步加载会议后端的静态资源--end
    let {getPreview, getCreate, doNewForm, changeNewForm, changePreviewMeetingTab,dialogStatus:{onlyFlowCreate,hideCreateEntry,workflowBaseIds}} = this.props.meetingDialog;
    //外部单页调用不调用接口的处理
    if (this.props.isSingle) {
      this.props.seatStore.setState({isSingle: true}); // 记录单页
      this.setState({visible:true})
      if (this.props.type == 'create') {//新建
        const {isInterval = false, meetingDate = '', begintime = '', endtime = '', address = '', urlParams} = this.props;
        let dateToMoment
        if(meetingDate == ''){
          dateToMoment = moment(new Date())
        }else{
          dateToMoment = moment(meetingDate)
        }
        getCreate('create', {
          ...urlParams,
          isInterval: isInterval,
          meetingDate: dateToMoment.format('YYYY-MM-DD'),
          begintime: begintime,
          endtime: endtime,
          address: address,
        }, (conditioninfo) => {
          this.setState({spinning: false}, doNewForm('create', (form) => {
            form.initFormFields(conditioninfo)
            changeNewForm(true)
          }))
        })
      }
      if (this.props.type == 'preview' && this.props.meetingId != '') {//查看
        if(this.props.isDiscuss === '1'){
          changePreviewMeetingTab('7')
        }
        getPreview({meetingid: this.props.meetingId,isfromchatshare:this.props.isfromchatshare || '' ,sharer:this.props.sharer || ''}, (conditioninfo) => {
          conditioninfo && this.setState({spinning: false}, doNewForm(this.props.meetingId, (form) => {
            form.initFormFields(conditioninfo)
            changeNewForm(true)
          }))
          !conditioninfo && this.setState({spinning: false})
        })
      }
    }
    //
    let {isRoomPlan = false} = this.props;
    if (isRoomPlan) {
      this.setState({isRoomPlanState: false})
      let {isInterval = false, meetingDate = '', address = '', begintime = '', endtime = '', meetingId} = this.props;
      if (this.state.type != this.props.type) {
        this.setState({type: this.props.type})
        if (this.state.type == 'preview' && this.props.type == 'edit' && this.state.visible) {
          let dateToMoment
          if(meetingDate == ''){
            dateToMoment = moment(new Date())
          }else{
            dateToMoment = moment(meetingDate)
          }
          let oldisInterval = isInterval ? 1 : ''
          getCreate('edit', {
            isInterval: oldisInterval,
            meetingDate: dateToMoment.format('YYYY-MM-DD'),
            meetingid: meetingId
          }, (conditioninfo) => {
            doNewForm(meetingId, (form) => {
              this.setState({spinning: false})
              form.initFormFields(conditioninfo)
              changeNewForm(true)
            }, 'edit')
          })
        }
      }

      if (this.state.visible != this.props.visible) {
        if (!this.state.visible && this.props.visible == true) {
          this.setState({spinning: true})
          if (this.props.type == 'preview') {
            getPreview({meetingid: this.props.meetingId}, (conditioninfo) => {
              conditioninfo && this.setState({spinning: false}, doNewForm(this.props.meetingId, (form) => {
                form.initFormFields(conditioninfo)
                changeNewForm(true)
              }))
              !conditioninfo && this.setState({spinning: false})
            })
          }
          if (this.props.type == 'create') {
            let dateToMoment = moment(meetingDate)
            let oldisInterval = isInterval ? 1 : ''
            getCreate('create', {
              isInterval: oldisInterval,
              meetingDate: dateToMoment.format('YYYY-MM-DD'),
              begintime: begintime,
              endtime: endtime,
              address: address ? address.id : '',
            }, (conditioninfo) => {
              this.setState({spinning: false}, doNewForm('create', (form) => {
                form.initFormFields(conditioninfo)
                changeNewForm(true)
              }))
            })
          }
          if (this.props.type == 'change') {

          }
        }
        this.setState({visible: this.props.visible}, changeNewForm(false))
      }
    }else{
      if (this.state.type == '' && this.props.type == 'preview' && this.props.visible) {
        getPreview({meetingid: this.props.meetingId}, (conditioninfo) => {
          conditioninfo && this.setState({spinning: false}, doNewForm(this.props.meetingId, (form) => {
            form.initFormFields(conditioninfo)
            changeNewForm(true)
          }))
          !conditioninfo && this.setState({spinning: false})
        })
      }else if (this.state.visible != this.props.visible) {
        if (!this.state.visible && this.props.visible == true) {
          this.setState({spinning: true, meetingId: this.props.meetingId})
          let {isInterval = false, meetingDate = '', address = '', begintime = '', endtime = ''} = this.props
          if (this.props.type == 'create') {
            let dateToMoment;
            if(meetingDate == ''){
              dateToMoment = moment(new Date())
            }else{
              dateToMoment = moment(meetingDate)
            }
            let oldisInterval = isInterval ? 1 : ''
            getCreate('create', {
              isInterval: oldisInterval,
              meetingDate: dateToMoment.format('YYYY-MM-DD'),
              begintime: begintime,
              endtime: endtime,
              address: address.id,
            }, (conditioninfo) => {
              this.setState({spinning: false}, doNewForm('create', (form) => {
                form.initFormFields(conditioninfo)
                changeNewForm(true)
              }))
            })
          }
        }
      }
      this.setState({visible: this.props.visible,type:this.props.type})
    }
    
    window.eventRegister.start('addCustomField4Check',function(){},function(){})

  }

  componentWillUnmount() {
    const { changePreviewMeetingTab } = this.props.meetingDialog;
    changePreviewMeetingTab(1);
    if (!(window.location.hash.indexOf('main/meeting/calView') > -1)) { // 解决浏览器回退导致的一系列问题
      // this.state.visible && window.location.reload()
    }
	}

  componentWillReceiveProps(nextProps) {
    let {isRoomPlan = false} = this.props
    let {isRoomPlanState} = this.state
    if (!isRoomPlan || !isRoomPlanState) {
      let {getPreview, getCreate, doNewForm, changeNewForm,
        deleteForm, getTabDecisionTable
      } = this.props.meetingDialog
      let {isInterval = false, meetingDate = '', address = '', begintime = '', endtime = ''} = nextProps
      if (this.state.type == 'preview' && nextProps.type == 'preview'
        && this.state.visible == nextProps.visible && nextProps.visible
        && this.state.meetingId != nextProps.meetingId) {
        this.setState({meetingId: nextProps.meetingId},
          getPreview({meetingid: nextProps.meetingId}, (conditioninfo) => {
            conditioninfo && this.setState({spinning: false}, doNewForm(nextProps.meetingId, (form) => {
              form.initFormFields(conditioninfo)
              changeNewForm(true)
            }))
            !conditioninfo && this.setState({spinning: false})
          }))
      }

      if (this.state.type != nextProps.type && nextProps.visible) {
        if (this.state.meetingId != nextProps.meetingId) {
          this.setState({type: nextProps.type, meetingId: nextProps.meetingId})
        } else {
          this.setState({type: nextProps.type})
        }

        if (this.state.type == 'preview' && nextProps.type == 'edit' && this.state.visible) {//编辑后直接，查看切换到新建界面
          deleteForm(nextProps.meetingId)
          let dateToMoment
          if(meetingDate == ''){
            dateToMoment = moment(new Date())
          }else{
            dateToMoment = moment(meetingDate)
          }
          let oldisInterval = isInterval ? 1 : ''
          this.setState({spinning: true})
          getCreate('edit', {
            isInterval: oldisInterval,
            meetingDate: dateToMoment.format('YYYY-MM-DD'),
            meetingid: nextProps.meetingId
          }, (conditioninfo) => {
            doNewForm(nextProps.meetingId, (form) => {
              this.setState({spinning: false})
              form.initFormFields(conditioninfo)
              changeNewForm(true)
            }, 'edit')
          })
        }

        // if (this.state.type == 'edit' && nextProps.type == 'preview' && this.state.visible) {//编辑页面保存 到 查看页面
        //   getPreview({meetingid: nextProps.meetingId}, (conditioninfo) => {
        //     conditioninfo && this.setState({spinning: false}, doNewForm(nextProps.meetingId, (form) => {
        //       form.initFormFields(conditioninfo)
        //       changeNewForm(true)
        //     }))
        //     !conditioninfo && this.setState({spinning: false})
        //   })
        // }

        // if (this.state.type == 'create' && nextProps.type == 'preview' && this.state.visible) {//新建后直接显示查看界面
        //   getPreview({meetingid: nextProps.meetingId}, (conditioninfo) => {
        //     conditioninfo && this.setState({spinning: false}, doNewForm(nextProps.meetingId, (form) => {
        //       form.initFormFields(conditioninfo)
        //       changeNewForm(true)
        //     }))
        //     !conditioninfo && this.setState({spinning: false})
        //   })
        // }

        if (this.state.type == 'change' && nextProps.type == 'preview' && this.state.visible) {//提交后直接显示查看界面
          getPreview({meetingid: nextProps.meetingId}, (conditioninfo) => {
            conditioninfo && this.setState({spinning: false}, doNewForm(nextProps.meetingId, (form) => {
              form.initFormFields(conditioninfo)
              changeNewForm(true)
            }))
            !conditioninfo && this.setState({spinning: false})
          })
        }

        if (this.state.type == 'decision' && nextProps.type == 'preview' && this.state.visible) {//会议决议->查看
          getPreview(
            {meetingid: nextProps.meetingId},
            (conditioninfo) => {
              conditioninfo && this.setState({spinning: false}, doNewForm(nextProps.meetingId, (form) => {
                form.initFormFields(conditioninfo)
                changeNewForm(true)
              }))
              !conditioninfo && this.setState({spinning: false})
            },
            (tabDecision) => {//会议决议-->查看，切换到查看到会议决议tan页，并刷新table
              getTabDecisionTable(tabDecision.list.sessionkey);
            }
          )
        }
      }

      if (this.state.visible != nextProps.visible) {
        if (!this.state.visible && nextProps.visible == true) {
          this.setState({spinning: true, meetingId: nextProps.meetingId})
          if (nextProps.type == 'preview') {
            getPreview({meetingid: nextProps.meetingId}, (conditioninfo) => {
              conditioninfo && this.setState({spinning: false}, doNewForm(nextProps.meetingId, (form) => {
                form.initFormFields(conditioninfo)
                changeNewForm(true)
              }))
              !conditioninfo && this.setState({spinning: false})
            })
          }
          if (nextProps.type == 'create') {
            let dateToMoment = moment(meetingDate)
            let oldisInterval = isInterval ? 1 : ''
            getCreate('create', {
              isInterval: oldisInterval,
              meetingDate: dateToMoment.format('YYYY-MM-DD'),
              begintime: begintime,
              endtime: endtime,
              address: address.id,
            }, (conditioninfo) => {
              this.setState({spinning: false}, doNewForm('create', (form) => {
                form.initFormFields(conditioninfo)
                changeNewForm(true)
              }))
            })
          }
          if (nextProps.type == 'change') {

          }
        }
        this.setState({visible: nextProps.visible}, changeNewForm(false))
      }
    }
  }

  onScale = () => {
    setTimeout(() => {
      this.setState({ currentTime: new Date().getTime() }); // 强制更新组件
    }, 0);
  }

  singleBtns = (btnArr) => {
    const { isBtnDown } = this.props;
    let btns = btnArr;
    btns.push(
      <WeaMoreButton ecId={`${this && this.props && this.props.ecId || ''}_WeaMoreButton@uf6a6a@singleMeetingMoreBtn`} className={isBtnDown ? '':'meeting-single-container'} datas={this.getRightMenu()} />
    );
    return btns;
  }

  render() {
    let {isInterval, meetingId, isSingle, isBtnDown} = this.props; //isSingle:判断是单页还是弹框
    let {visible, type, spinning} = this.state;
    let {logStore,dialogStatus,setState,weaDialogContentHeight, previewMeetingResultInfo,overMeetingDialogVisiable,nowValue} = this.props.meetingDialog;
    let { meetingEndDate ,meetingBeginDate} = toJS(dialogStatus);
    let contentDom = null;
    let dialogTitle = type == 'preview' ? getLabel(384485, '查看会议') :
      type == 'create' ? getLabel(383430, '新建会议') :
        type == 'decision' ? getLabel(2194, '会议决议') :
          type == 'edit' ? getLabel(384486, '编辑会议') :
            type == 'change' ? getLabel(384487, '变更会议') : ''
    let weadialogHeight =  400;
    let baseIdsArr = [];

    const style1 = {
      paddingBottom: '10px',
      paddingLeft: '12%',
      paddingTop: '15px'
    };
    let now = new Date()
    let nowValues =nowValue != ''? this.dateFormat("YYYY-mm-dd HH:MM:SS", nowValue):'';
    let alldate = meetingEndDate.split(" ")[0];//截止日期
    let alldates = meetingBeginDate.split(" ")[0];//开始日期
    let dayTime = new Date(meetingEndDate).getDate();//截止日期-天
    let dayTimes = new Date(meetingBeginDate).getDate();//开始日期-天
    let hourTime = new Date(meetingEndDate).getHours();//截止日期-小时
    let hourTimes = new Date(meetingBeginDate).getHours();//开始日期-小时
    let secondTime = new Date(meetingEndDate).getMinutes();//截止日期-分钟
    let secondTimes = new Date(meetingBeginDate).getMinutes();//开始日期-分钟
    
    const style2 = {
      paddingBottom: '15px',
      paddingLeft: '12%'
    };

    let buttons = [
    <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@kvhoab@doOverMeeting`} type="primary" onClick={this.doOverMeeting}>{getLabel(826,'确定')}</Button>,
    <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@eyxw7s@doCloseOverMeeting`} type="ghost" onClick={this.doCloseOverMeeting}>{getLabel(201,'取消')}</Button>
    ];

    contentDom = (
      <div>
        <div class='ant-confirm-content wdb wea-f14' style={ style1 }>{ getLabel(126004, '确定要提前结束会议吗？')}</div>
        <div style={style2}>
          <span style={{ fontSize: '14px',paddingRight: '7px' }}>{getLabel('31233','会议结束时间')} :</span>
          <WeaDatePicker ecId={`${this && this.props && this.props.ecId || ''}_WeaDatePicker@nsazqf`}  
            value = { nowValues }
            showTime = {true}
            showTime={{ format: "HH:mm:ss" }}
            format="yyyy-MM-dd HH:mm:ss"
            style={{width:'180px'}}
            endValue={alldate}
            startValue={alldates}
            needSecond={true}
            viewAttr={3}
            onChange={value => {
              setState({nowValue:value.length>0?new Date(value):''})
          }}
          disabledTimeConfig={{
            dayConfig: {
              [dayTime]: {
                disabledHour: this.rangeH(hourTimes,hourTime+1),
                HourConfig: {
                  [hourTimes]: {
                    disabledMinute:  this.rangeM(secondTimes+1,60),
                    minuteConfig: {
                      [secondTimes]: this.range(0,60),
                    }
                  },
                  [hourTime]: {
                    disabledMinute:  this.range(secondTime,60),
                    minuteConfig: {
                      [secondTime]: this.range(0,60),
                    }
                  }
                }
              }
            }
          }}
          />
          </div>
      </div>
    )

    
    if(dialogStatus.workflowBaseIds != ''){
      baseIdsArr = dialogStatus.workflowBaseIds.split(',')
    }
    if(isSingle && dialogStatus.onlyFlowCreate==1 && dialogStatus.hideCreateEntry==1 && type=='create'){
      return errorModal({
        title: getLabel(15172, '系统提示'),
        content: getLabel(510049, '请通过流程新建会议！'),
        onOk() {
          window.close();
        },
      })
    }else if(isSingle && dialogStatus.onlyFlowCreate==1 && dialogStatus.hideCreateEntry==0 && baseIdsArr.length == 0 && type=='create' && visible){
      return errorModal({
        title: getLabel(15172, '系统提示'),
        content: getLabel(510148, '系统查找不到新建会议流程！'),
      })
    }else if(isSingle && dialogStatus.onlyFlowCreate==1 && dialogStatus.hideCreateEntry==0 && baseIdsArr.length == 1 && type=='create'){
      window.location.href=`/spa/workflow/static4form/index.html#/main/workflow/req?iscreate=1&workflowid=${dialogStatus.workflowBaseIds}`;
    }
    
    if (isSingle) {
      let singleBtns = this.getButton();
      let btnsArr = [];
      singleBtns = singleBtns.forEach(r => {
        if(r) {
          btnsArr.push(r);
        }
      });
      return (
        <div className="wea-meeting-dialog" id="meeting-dialog-id" style={{height: '100%'}} previewMeetingResultInfo={previewMeetingResultInfo}>
          <WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@h1mnog`} 
                  datas={dialogStatus.onlyFlowCreate==1&&!isInterval&&type == 'create' ?[]:this.getRightMenu()}
                  collectParams={{
                    favname:'会议',
                    favouritetype: 2,
                    objid: 0,
                    importantlevel:1,
                }}>
          <div className='wea-meeting-dialog-single'>
            <WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@tj1khq`}
              title={dialogTitle}
              icon={<i className='icon-coms-meeting'/>}
              iconBgcolor='#F14A2D'
              style={{ height: 'calc(100% - 52px)'}}
              buttons={isBtnDown ? [] : (dialogStatus.onlyFlowCreate==1 && dialogStatus.hideCreateEntry==0&&!isInterval&&type == 'create'?[]: this.singleBtns(btnsArr))}
              
            >
              <div style={{ height: isBtnDown ? 'calc(100% - 52px)' : '100%'}}>
                <Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@3hu6ez`} wrapperClassName='singleSpin' spinning={spinning}>
                  {((dialogStatus.onlyFlowCreate==0&&dialogStatus.hideCreateEntry==0 || isInterval)&&type == 'create') || type == 'edit' || type == 'change' ?
                    <Create ecId={`${this && this.props && this.props.ecId || ''}_Create@9uaqzx`} ref='create' meetingId={meetingId} setRoomPlan={this.setRoomPlan} type={type}
                            isInterval={isInterval} isSingle={isSingle} handleSubmit={this.handleSubmit}/> : ''}
                  {dialogStatus.onlyFlowCreate==1 && dialogStatus.hideCreateEntry==0&&!isInterval&&type == 'create'?
                    <iframe src={`/spa/workflow/static/index.html#/main/workflow/add?isNeedTop=0&isNeedTab=0&isNeedCollect=0&wfRange=${dialogStatus.workflowBaseIds}${dialogStatus.addRequestUrlParams}`} id="tabcontentframe" name="tabcontentframe" width="100%" height="100%" frameBorder={0} scrolling="no"  />:''}
                  {type == 'preview' ?
                    <Preview ecId={`${this && this.props && this.props.ecId || ''}_Preview@h4fuao`} ref='preview'  isInterval={isInterval} setRoomPlan={this.setRoomPlan} meetingId={meetingId} isSingle={isSingle}/> : ''}
                  {type == 'decision' ? <DecisionDialog ecId={`${this && this.props && this.props.ecId || ''}_DecisionDialog@p5bfn1`} isSingle={isSingle} ref='meetingDecisionDialog'/> : ''}
                </Spin>
              </div>
            </WeaTop>
            {isBtnDown && <WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@8rs3rz`}  
              className='isBtnDown'
              buttons={dialogStatus.onlyFlowCreate==1 && dialogStatus.hideCreateEntry==0&&!isInterval&&type == 'create'?[]: this.singleBtns(btnsArr) }
            ></WeaTop>}
          </div>
          <EndRepeatMeeting ecId={`${this && this.props && this.props.ecId || ''}_EndRepeatMeeting@zgc6ci`} doRefesh={this.doRefesh} storeKey={2}/>
          {this.props.meetingDialog.loaded && window.weaMeetingEngine && window.weaMeetingEngine.com && window.weaMeetingEngine.com.CreateTypeDialog &&
          (<window.weaMeetingEngine.com.CreateTypeDialog ecId={`${this && this.props && this.props.ecId || ''}_undefined@skvgjh`} />)}
          {this.props.meetingDialog.loaded && window.weaMeetingEngine && window.weaMeetingEngine.com && window.weaMeetingEngine.com.CreateRoomDialog &&
          (<window.weaMeetingEngine.com.CreateRoomDialog ecId={`${this && this.props && this.props.ecId || ''}_undefined@2ymkvx`} isCustom/>)}
          <WeaLogViewComp ecId={`${this && this.props && this.props.ecId || ''}_WeaLogViewComp@ffytm3`} visible={this.state.logvisible} onCancel={this.toggleLog} logStore={logStore} 
          logType={dialogStatus.logType} logSmallType={dialogStatus.logSmallType}
          targetId={dialogStatus.targetId}/>
        </WeaRightMenu>
        </div>
      )
    } else {
      return (
        <div className="wea-meeting-dialog" id="meeting-dialog-id" previewMeetingResultInfo={previewMeetingResultInfo} date={this.state.currentTime}>
          {(meetingId || (type == 'create' && (dialogStatus.hideCreateEntry==1 || dialogStatus.hideCreateEntry==0)))&&<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@3eld2n`}
            ref='weameeting_dialog'
            visible={visible}
            title={dialogTitle}
            icon="icon-coms-meeting"
            iconBgcolor="#f14a2d"
            className="meetingDialog"
            buttons={dialogStatus.onlyFlowCreate==1&&!isInterval&&type == 'create' ?[]:this.getButton()}
            moreBtn={dialogStatus.onlyFlowCreate==1&&!isInterval&&type == 'create' ?{}:{
              datas : this.getRightMenu(),
              collectParams: {
                favname:'会议',
                favouritetype: 2,
                objid: 0,
                importantlevel:1,
              }
            }}
            style={{width: '790px', height: '500px'}}
            onCancel={() => this.onlyClose()}
            scalable={true}
            onScale={() => this.onScale()}
          >
            <Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@yxhotk`} spinning={spinning} style={{height: '100%'}}>
              <WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@h1mnog`} 
                  datas={dialogStatus.onlyFlowCreate==1&&!isInterval&&type == 'create' ?[]:this.getRightMenu()}
                  collectParams={{
                    favname:'会议',
                    favouritetype: 2,
                    objid: 0,
                    importantlevel:1,
                }}>
                {((baseIdsArr.length<1 || isInterval)&&type == 'create') || type == 'edit' || type == 'change' ?
                  <Create ecId={`${this && this.props && this.props.ecId || ''}_Create@9wxbhf`} ref='create' meetingId={meetingId} setRoomPlan={this.setRoomPlan} type={type} contentHeight={this.refs.weameeting_dialog ? this.refs.weameeting_dialog.state.height : weaDialogContentHeight }
                          isInterval={isInterval} isSingle={isSingle} handleSubmit={this.handleSubmit}/> : ''}
                {dialogStatus.onlyFlowCreate==1 && dialogStatus.hideCreateEntry==0&&!isInterval&&type == 'create'&&baseIdsArr.length>0?
                <iframe src={`/spa/workflow/static/index.html#/main/workflow/add?isNeedTop=0&isNeedTab=0&isNeedCollect=0&wfRange=${dialogStatus.workflowBaseIds}${dialogStatus.addRequestUrlParams}`} id="tabcontentframe" name="tabcontentframe" width="100%" height="100%" frameBorder={0} scrolling="no"  />:''}
                {type == 'preview' ?
                  <Preview ecId={`${this && this.props && this.props.ecId || ''}_Preview@4zdh0o`} ref='preview' isInterval={isInterval} setRoomPlan={this.setRoomPlan} meetingId={meetingId} isSingle={isSingle} contentHeight={this.refs.weameeting_dialog ? this.refs.weameeting_dialog.state.height : weaDialogContentHeight } /> : ''}
                {type == 'decision' ? <DecisionDialog ecId={`${this && this.props && this.props.ecId || ''}_DecisionDialog@kf2hnu`} ref='meetingDecisionDialog' contentHeight={this.refs.weameeting_dialog ? this.refs.weameeting_dialog.state.height : weaDialogContentHeight } /> : ''}
              </WeaRightMenu>
            </Spin>
          </WeaDialog>}
        
        {<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@41t3o2`}
        title={getLabel(131329,'信息确认')}
        onCancel={() => setState({ overMeetingDialogVisiable: false ,nowValue:new Date()})}
        visible={overMeetingDialogVisiable}
        style={{ width: 450, height: 150 }}
        buttons={buttons}
        hasScroll
      >
        {contentDom}
      </WeaDialog>}
     
          {this.props.meetingDialog.loaded && window.weaMeetingEngine && window.weaMeetingEngine.com && window.weaMeetingEngine.com.CreateTypeDialog &&
          (<window.weaMeetingEngine.com.CreateTypeDialog ecId={`${this && this.props && this.props.ecId || ''}_undefined@1vjmxi`}/>)}
          {this.props.meetingDialog.loaded && window.weaMeetingEngine && window.weaMeetingEngine.com && window.weaMeetingEngine.com.CreateRoomDialog &&
          (<window.weaMeetingEngine.com.CreateRoomDialog ecId={`${this && this.props && this.props.ecId || ''}_undefined@mqb0u7`} isCustom/>)}
          <EndRepeatMeeting ecId={`${this && this.props && this.props.ecId || ''}_EndRepeatMeeting@oonrzd`} doRefesh={this.doRefesh} storeKey={2}/>
          <WeaLogViewComp ecId={`${this && this.props && this.props.ecId || ''}_WeaLogViewComp@3fnv6g`} visible={this.state.logvisible} onCancel={this.toggleLog} logStore={logStore} 
          logType={dialogStatus.logType} logSmallType={dialogStatus.logSmallType}
          targetId={dialogStatus.targetId}/>
          {visible && spinning && <div className="meeting-mask-layer" style={{ position: 'fixed', top: 0, bottom: 0, width: '100%', zIndex: 9999 }}></div>}
        </div>
      )
    }
  }

  openSeatInfo = () => {
    const {seatStore} = this.props
    seatStore.setState({seatLayoutSettingVisible: true, isSetting: true})
  }

  toggleLog = () => {
    this.setState({logvisible: !this.state.logvisible});
  }

  chatShare = () =>{
    let {setDialogState} = this.props.meetingDialog;
    setDialogState({chatVisible:true})
  }

  setType = (type) => {
    this.props.setType && this.props.setType(type)

  }

  setRoomPlan = (bool) => {
    this.props.setRoomPlan && this.props.setRoomPlan(bool)
  }

  doRefesh = () => {//刷新外层页面，不关闭该弹出框
    this.props.doRefesh && this.props.doRefesh()
  }

  doOverMeeting = () =>{
    let{meetingId} = this.props;
    let {overMeeting,nowValue,dialogStatus,setState} = this.props.meetingDialog;
    let{meetingEndDate} = toJS(dialogStatus)
    let nowValues = nowValue != ''?this.dateFormat("YYYY-mm-dd HH:MM:SS", nowValue):'';
    if(nowValues && meetingEndDate){
      let date1 = new Date(nowValue);
      let date2 = new Date(meetingEndDate+':00')
      if(date1.getTime()>date2.getTime()){
        message.error(`${getLabel(523524,'结束时间不可以在原会议结束时间后，请重新选择。')}`);
      }else{
        overMeeting({meetingid:meetingId,overTime:nowValues}, () => {
          message.success(`${getLabel(30700,'操作成功')}`);
          this.props.isSingle && this.getPreview(this.props.meetingId);
          if(this.props.isSingle){
            this.getPreview(meetingId)
          }
          setState({overMeetingDialogVisiable:false,nowValue:new Date()})
          this.doClose()
          //this.doRefesh();
        })
      }
    }else{
      message.error(`${getLabel(384010,'存在必填项未填写')}`);
    }
  }

  doCloseOverMeeting = ()=>{
    let {setState} = this.props.meetingDialog;
    setState({ overMeetingDialogVisiable: false ,nowValue:new Date()});
  }

  doClose = () => {//刷新外层页面，并关闭该弹出框
    let {changePreviewMeetingTab} = this.props.meetingDialog;
    if(this.props.isSingle){}else {
      this.props.setDialog(false);
    }
    changePreviewMeetingTab(1);
    this.doRefesh();
    this.setState({spinning: false});
  }

  onlyClose = () => {// 只关闭该弹出框
    let {type} = this.state
    let { changePreviewMeetingTab, form, setState } = this.props.meetingDialog;
    // 关闭弹框时，清空表单中的数据，以免影响后续操作
    this.props.meetingDialog.dialogStatus.allCreateDatas = {};
    setState({ topicViewActive: false, serviceViewActive: false });

    if (type == 'decision') {
      this.props.setType('preview');
      changePreviewMeetingTab(1);
    } else {
      //解决会议查询页面，复制会议后，直接关闭弹出框，再查看其他会议时，无法加载的问题
      this.props.meetingId&&this.props.setAll&&this.props.setAll(this.props.meetingId, true, 'preview')
      
      this.props.setDialog(false);
      changePreviewMeetingTab(1);
      this.setState({visible: false}, () => {
      })
      // let conditioninfo = this.getCondition();
      // if (!conditioninfo) conditioninfo = [];
      // let key = meetingId == '' ? 'create' : meetingId;

      // let isFormInit = false;
      // if (form[key]) {
      //   isFormInit = form[key].isFormInit
      // }
    }
  }

  getRightMenu = () =>{
    let btnArr = [];
    const {meetingId, seatStore, seatCardStore} = this.props;
    let {dialogStatus,decisionToGovernBtn} = this.props.meetingDialog;
    let {previewButtons, previewmeetingTab, jurisdiction} = toJS(dialogStatus);
    const {type} = this.state;
    if (type == 'preview') {
      let buttonsCreate = [];
      if(previewButtons && previewButtons.length > 0 && jurisdiction[meetingId] != 'noright'){
        previewButtons.some((element) => {
          return element == 'doEdit'
        }) && buttonsCreate.push({
          key: 'doEdit',
          content: getLabel(26473, '编辑'),
          icon: <i className='icon-coms-edit' />,
          onClick: this.edit,
        });

        previewButtons.some((element) => {
          return element == 'meetingToGovern'
        }) && buttonsCreate.push({
          key: 'meetingToGovern',
          content: getLabel(521828, '会议转督办'),
          icon: <i className='icon-coms-Rightmenu-Revoke' />,
          onClick: this.meetingToGovern,
        });

        previewmeetingTab == '5' && previewButtons.some((element) => {
          return element == 'meetingDecisionToGovern'
        }) && buttonsCreate.push({
          key: 'meetingDecisionToGovern',
          content: getLabel(523328, '决议转督办'),
          icon: <i className='icon-coms-Rightmenu-Revoke' />,
          onClick: this.meetingDecisionToGovern,
        });

        previewButtons.some((element) => {
          return element == 'onChgIntvl'
        }) && buttonsCreate.push({
          key: 'onChgIntvl',
          content: getLabel(33172, '提前结束重复会议'),
          icon: <i className='icon-coms-overtime' />,
          onClick: this.onChgIntvl,
        });

        previewButtons.some((element) => {
          return element == 'cancelIntvl'
        }) && buttonsCreate.push({
          key: 'cancelIntvl',
          content: getLabel(384725, '取消周期会议'),
          icon: <i className='icon-coms-delete' />,
          onClick: this.cancelIntvl,
        });

        previewButtons.some((element) => {
          return element == 'onStopIntvl'
        }) && buttonsCreate.push({
          key: 'onStopIntvl',
          content: getLabel(384726, '停止重复会议'),
          icon: <i className='icon-coms-edit' />,
          onClick: this.onStopIntvl,
        });

        previewButtons.some((element) => {
          return element == 'changeMeeting'
        }) && buttonsCreate.push({
          key: 'changeMeeting',
          content: getLabel(384487, '变更会议'),
          icon: <i className='icon-coms-edit' />,
          onClick: this.changeMeeting,
        });

        previewButtons.some((element) => {
          return element == 'overMeeting'
        }) && buttonsCreate.push({
          key: 'overMeeting',
          content: getLabel(126003, '提前结束'),
          icon: <i className='icon-coms-overtime' />,
          onClick: this.overMeeting,
        });

        previewButtons.some((element) => {
          return element == 'onShowDecision'
        }) && buttonsCreate.push({
          key: 'onShowDecision',
          content: getLabel(2194, '会议决议'),
          icon: <i className='icon-coms-edit' />,
          onClick: this.onShowDecision,
        });

        previewButtons.some((element) => {
          return element == 'copyNewMeeting'
        }) && buttonsCreate.push({
          key: 'copyNewMeeting',
          content: getLabel(77, '复制'),
          icon: <i className='icon-coms-form-copy' />,
          disabled:dialogStatus.repeatLoading,
          onClick: this.copy,
        });

        previewButtons.some((element) => {
          return element == 'cancelMeeting'
        }) && buttonsCreate.push({
          key: 'cancelMeeting',
          content: getLabel(20115, '取消会议'),
          icon: <i className='icon-coms-delete' />,
          onClick: this.cancelMeeting,
        });

        previewButtons.some((element) => {
          return element == 'doSubmit'
        }) && buttonsCreate.push({
          key: 'doSubmit',
          content: getLabel(142, '批准'),
          icon: <i className='icon-coms-Approval' />,
          onClick: this.doSubmit,
        });

        previewButtons.some((element) => {
          return element == 'doSubmit2'
        }) && buttonsCreate.push({
          key: 'doSubmit2',
          content: getLabel(15143, '提交审批'),
          icon: <i className='icon-coms-Approval' />,
          onClick: this.doSubmit2,
          disabled: dialogStatus.submitLoading
        });

        previewButtons.some((element) => {
          return element == 'doReject'
        }) && buttonsCreate.push({
          key: 'doReject',
          content: getLabel(236, '退回'),
          icon: <i className='icon-coms-edit' />,
          onClick: this.doReject,
        });

        previewButtons.some((element) => {
          return element == 'reSubmit'
        }) && buttonsCreate.push({
          key: 'reSubmit',
          content: getLabel(15143, '提交审批'),
          icon: <i className='icon-coms-Approval' />,
          onClick: this.reSubmit,
          disabled: dialogStatus.submitLoading
        });

        previewButtons.some((element) => {
          return element == 'reSubmit2'
        }) && buttonsCreate.push({
          key: 'reSubmit2',
          content: getLabel(725, '提交'),
          icon: <i className='icon-coms-Preservation' />,
          onClick: this.reSubmit2.bind(this, 'draftSubmit', meetingId),
          disabled: dialogStatus.submitLoading
        });

        previewButtons.some((element) => {
          return element == 'doDelete'
        }) && buttonsCreate.push({
          key: 'doDelete',
          content: getLabel(91, '删除'),
          icon: <i className='icon-coms-delete' />,
          onClick: this.doDelete,
        });
        previewButtons.some((element) => {
          return element == 'doChatShare'
        }) && buttonsCreate.push({
          key: 'doChatShare',
          content: getLabel(126091, '分享'),
          icon: <i className='icon-coms-Batch-sharing' />,
          onClick: this.chatShare,
        });
        previewButtons.some((element) => {
          return element == 'doViewLog'
        }) && buttonsCreate.push({
          key: 'doViewLog',
          content: getLabel(384724, '显示日志'),
          icon: <i className='icon-coms-Print-log' />,
          onClick: this.toggleLog,
        });
        previewButtons.some((element) => {
          return element == 'doSeat'
        }) && buttonsCreate.push({
          key: 'arrangeSeat',
          content: getLabel('507097','排座调整'),
          icon: <i className='icon-coms-edit' />,
          onClick: this.openSeatInfo,
        });
        previewButtons.some((element) => {
          return element == 'doSeat'
        }) && (parseInt(previewmeetingTab) === 9) && buttonsCreate.push({
          key: 'seatCard',
          content: getLabel('512438','打印席卡') ,
          icon: <i className='icon-coms-edit' />,
          onClick: () => seatCardStore.setState({seatCardVisible: true}),
        });
      }
      return buttonsCreate
    }
    if (type == 'decision') {
      let decisionButtons = [ // 点击保存或提交时,加载(loading)状态,另一按钮禁用(disabled)
        {
          key: 'decisionSave',
          content: getLabel(30986, '保存'),
          icon: <i className='icon-coms-edit' />,
          onClick: this.decisionSave,
          disabled: dialogStatus.saveLoading || dialogStatus.submitLoading
        },
        {
          key: 'decisionSubmit',
          content: getLabel(725, '提交'),
          icon: <i className='icon-coms-Preservation' />,
          onClick: this.decisionSubmit,
          disabled: dialogStatus.saveLoading || dialogStatus.submitLoading
        },
        {
          key: 'decisionGoBack',
          content: getLabel(130339, "返回"),
          icon: <i className='icon-coms-Reset' />,
          onClick: this.decisionGoBack,
        }
      ]
      return decisionButtons
    }
    if (type == 'change') {
      let buttonsCreate = [
        {
          key: 'save2',
          content: getLabel(725, '提交'),
          icon: <i className='icon-coms-Preservation' />,
          onClick: this.handleSubmit.bind(this, 'change', meetingId),
        },
        {
          key: 'decisionGoBack',
          content: getLabel(130339, "返回"),
          icon: <i className='icon-coms-Reset' />,
          onClick: this.decisionGoBack,
        }
      ]
      return buttonsCreate
    }
    if (type == 'create') {
      let buttonsCreate = [ // 当前点击按钮一次后加载(loading)并禁用(disabled),另外一个禁用
        {
          key: 'screenPreview',
          content: getLabel(384727, '大屏签到预览'),
          icon: <i className='icon-coms-edit' />,
          onClick: this.screenPreview,
        },
        {
          key: 'draft',
          content: getLabel(220, '草稿'),
          icon: <i className='icon-coms-edit' />,
          onClick: this.handleSubmit.bind(this, 'draft', meetingId),
        },
        {
          key: 'sub',
          content: getLabel(725, '提交'),
          icon: <i className='icon-coms-Preservation' />,
          onClick: this.handleSubmit.bind(this, 'submit', meetingId),
        },
      ]
      previewmeetingTab != 4 && buttonsCreate.shift()
      return buttonsCreate
    }
    if (type == 'edit') {
      let buttonsCreate = [
        {
          key: 'screenPreview',
          content: getLabel(384727, '大屏签到预览'),
          icon: <i className='icon-coms-edit' />,
          onClick: this.screenPreview,
        },
        {
          key: 'draft',
          content: getLabel(30986, '保存'),
          icon: <i className='icon-coms-edit' />,
          onClick: this.handleSubmit.bind(this, 'draftSave', meetingId),
        },
      ]
      previewmeetingTab != 4 && buttonsCreate.shift()
      return buttonsCreate
    }
  }

  getButton = () => {
    const {meetingId, seatStore, seatCardStore} = this.props;
    let {dialogStatus, setSignStatus,decisionToGovernBtn } = this.props.meetingDialog;
    let {previewButtons, previewmeetingTab, jurisdiction, tabs} = toJS(dialogStatus);
    const {type} = this.state;
    if (type == 'preview') {
      let buttonsCreate = (previewButtons && previewButtons.length > 0 && jurisdiction[meetingId] != 'noright') ? [
        previewButtons.some((element) => {
          return element == 'meetingToGovern'
        }) &&
        <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@recogx@meetingToGovern`} key="meetingToGovern" type="primary" onClick={this.meetingToGovern}>{getLabel(521828, '会议转督办')}</Button>,

        previewmeetingTab == '5' && previewButtons.some((element) => {
          return element == 'meetingDecisionToGovern'
        }) &&
        <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@1naou7@meetingDecisionToGovern`} key="meetingDecisionToGovern" type="primary" onClick={this.meetingDecisionToGovern}>{getLabel(523328, '决议转督办')}</Button>,

        previewButtons.some((element) => {
          return element == 'doEdit'
        }) &&
        <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@kcot29@doEdit`} key="doEdit" type="primary" disabled={dialogStatus.submitLoading} onClick={this.edit}>{getLabel(26473, '编辑')}</Button>,

        previewButtons.some((element) => {
          return element == 'onChgIntvl'
        }) &&
        <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@v6wimu@onChgIntvl`} key="onChgIntvl" type="primary" onClick={this.onChgIntvl}>{getLabel(33172, '提前结束重复会议')}</Button>,

        previewButtons.some((element) => {
          return element == 'cancelIntvl'
        }) &&
        <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@177i7p@cancelIntvl`} key="cancelIntvl" type="primary" onClick={this.cancelIntvl}>{getLabel(384725, '取消周期会议')}</Button>,

        previewButtons.some((element) => {
          return element == 'onStopIntvl'
        }) &&
        <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@0eihze@onStopIntvl`} key="onStopIntvl" type="primary" onClick={this.onStopIntvl}>{getLabel(384726, '停止重复会议')}</Button>,

        previewButtons.some((element) => {
          return element == 'changeMeeting'
        }) &&
        <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@oxxqop@changeMeeting`} key="changeMeeting" type="primary" onClick={this.changeMeeting}>{getLabel(384487, '变更会议')}</Button>,

        previewButtons.some((element) => {
          return element == 'overMeeting'
        }) &&
        <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@dfnby2@overMeeting`} key="overMeeting" type="primary" onClick={this.overMeeting}>{getLabel(126003, '提前结束')}</Button>,

        previewButtons.some((element) => {
          return element == 'onShowDecision'
        }) &&
        <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@l7c9ag@onShowDecision`} key="onShowDecision" type="primary" onClick={this.onShowDecision}>{getLabel(2194, '会议决议')}</Button>,

        previewButtons.some((element) => {
          return element == 'copyNewMeeting'
        }) &&
        <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@8eblwi@copyNewMeeting`} key="copyNewMeeting" type="primary" loading={dialogStatus.repeatLoading} disabled={dialogStatus.repeatLoading} onClick={this.copy}>{getLabel(77, '复制')}</Button>,

        previewButtons.some((element) => {
          return element == 'cancelMeeting'
        }) &&
        <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@mta1wd@cancelMeeting`} key="cancelMeeting" type="primary" onClick={this.cancelMeeting}>{getLabel(20115, '取消会议')}</Button>,

        !this.props.isSingle && previewButtons.some((element) => {
          return element == 'exportExcel'
        }) &&
        <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@o3lxnd@exportExcel`} key="exportExcel" style={{display: 'none'}} type="primary" onClick={() => {
        }}>{getLabel(28343, '导出Excel')}</Button>,

        previewButtons.some((element) => {
          return element == 'doSubmit'
        }) &&
        <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@g2irqj@doSubmit`} key="doSubmit" type="primary" onClick={this.doSubmit}>{getLabel(142, '批准')}</Button>,

        previewButtons.some((element) => {
          return element == 'doSubmit2'
        }) &&
        <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@7q6jm3@doSubmit2`} key="doSubmit2" type="primary" loading={dialogStatus.submitLoading} disabled={dialogStatus.submitLoading}
         onClick={this.doSubmit2}>{getLabel(15143, '提交审批')}</Button>,

        previewButtons.some((element) => {
          return element == 'doReject'
        }) &&
        <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@v5k6c4@doReject`} key="doReject" type="primary" onClick={this.doReject}>{getLabel(236, '退回')}</Button>,

        previewButtons.some((element) => {
          return element == 'reSubmit'
        }) &&
        <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@0fremb@reSubmit`} key="reSubmit" type="primary" loading={dialogStatus.submitLoading} disabled={dialogStatus.submitLoading}
          onClick={() => {this.reSubmit()}}>{getLabel(15143, '提交审批')}</Button>,

        previewButtons.some((element) => {
          return element == 'reSubmit2'
        }) &&
        <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@hp64hw@reSubmit2`} key="reSubmit2" type="primary" loading={dialogStatus.submitLoading} disabled={dialogStatus.submitLoading}
                onClick={this.reSubmit2.bind(this, 'draftSubmit', meetingId)}>{getLabel(725, '提交')}</Button>,

        previewButtons.some((element) => {
          return element == 'doDelete'
        }) &&
        <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@4rjime@doDelete`} key="doDelete" type="primary" disabled={dialogStatus.submitLoading} onClick={this.doDelete}>{getLabel(91, '删除')}</Button>,

        // previewButtons.some((element) => {
        //   return element == 'doViewLog'
        // }) &&
        // <Button key="doViewLog" type="primary" onClick={this.toggleLog}>{getLabel(384724, '显示日志')}</Button>,
       
        previewButtons.some((element) => {
          return element == 'doSeat'
        }) &&
        <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@wehu8t@arrangeSeat`} key="arrangeSeat" type="primary" onClick={()=>{seatStore.setState({seatLayoutSettingVisible: true, isSetting: true})}}>{getLabel('507097','排座调整')}</Button>,
        previewButtons.some((element) => {
          return previewmeetingTab == '9' && element == 'doSeat'
        }) &&
        <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@hs103b@seatCard`} key="seatCard" type="primary" onClick={()=>{seatCardStore.setState({seatCardVisible: true})}}>{getLabel('512438','打印席卡') }</Button>,
       
        // previewButtons.some((element) => {
        //   return previewmeetingTab == '6' && element == "chanageSignBackTime"
        // }) &&
        // <Button key="chanageSignBackTime" type="primary" onClick={()=>{setSignStatus({limitDialogVisible: true})}}>{getLabel('514149','设置签到/签退时间') }</Button>,
      ] : []
      return buttonsCreate
    }
    if (type == 'decision') {
      let decisionButtons = [ // 点击保存或提交时,加载(loading)状态,另一按钮禁用(disabled)
        <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@s8kn7t@decisionSave`} key="decisionSave" style={{display: 'inline-block'}} type="primary" loading={dialogStatus.saveLoading}
                disabled={dialogStatus.saveLoading || dialogStatus.submitLoading}
                onClick={this.decisionSave}>{getLabel(30986, '保存')}</Button>,
        <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@r8nmqv@decisionSubmit`} key="decisionSubmit" style={{display: 'inline-block'}} type="primary"
                loading={dialogStatus.submitLoading} disabled={dialogStatus.saveLoading || dialogStatus.submitLoading}
                onClick={this.decisionSubmit}>{getLabel(725, '提交')}</Button>,
        <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@d8929d@decisionGoBack`} key="decisionGoBack" style={{display: 'inline-block'}} type="primary"
                onClick={this.decisionGoBack}>{getLabel(130339, "返回")}</Button>,
      ]
      return decisionButtons
    }
    if (type == 'change') {
      let buttonsCreate = [
        <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@3q9w25@save2`} key="save2" type="primary" size="large"
                onClick={this.handleSubmit.bind(this, 'change', meetingId)}>{getLabel(725, '提交')}</Button>,
        <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@ivl7iy@decisionGoBack`} key="decisionGoBack" style={{display: 'inline-block'}} type="primary"
                onClick={this.decisionGoBack}>{getLabel(130339, "返回")}</Button>,
      ]
      return buttonsCreate
    }
    if (type == 'create') {
      let buttonsCreate = [ // 当前点击按钮一次后加载(loading)并禁用(disabled),另外一个禁用
        <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@74tc4n@screenPreview`} key="screenPreview" type="primary" onClick={this.screenPreview}>{getLabel(384727, '大屏签到预览')}</Button>,
        <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@gkewqv@draft`} key="draft" type="primary" loading={dialogStatus.saveLoading} disabled={dialogStatus.saveLoading || dialogStatus.submitLoading}
                onClick={this.handleSubmit.bind(this, 'draft', meetingId)}>{getLabel(220, '草稿')}</Button>,
        <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@gcb7si@sub`} key="sub" type="primary" loading={dialogStatus.submitLoading} disabled={dialogStatus.saveLoading || dialogStatus.submitLoading}
                onClick={this.handleSubmit.bind(this, 'submit', meetingId)}>{getLabel(725, '提交')}</Button>,
      ]
      previewmeetingTab != 4 && buttonsCreate.shift()
      return buttonsCreate
    }
    if (type == 'edit') {
      let buttonsCreate = [
        <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@xptn9l@screenPreview`} key="screenPreview" type="primary" onClick={this.screenPreview}>{getLabel(384727, '大屏签到预览')}</Button>,
        <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@fk3yx5@draft`} key="draft" type="primary" loading={dialogStatus.saveLoading} disabled={dialogStatus.saveLoading}
                onClick={this.handleSubmit.bind(this, 'draftSave', meetingId)}>{getLabel(30986, '保存')}</Button>,
      ]
      previewmeetingTab != 4 && buttonsCreate.shift()
      return buttonsCreate
    }
  }

  screenPreview = () => {
    const {meetingDialog, meetingId} = this.props;
    let {
      bgcolor = '',
      bgimg = '',
      bgimgLoadlink = '',
      fontcolor = '',
      showdep = '1',
      showhead = '1',
      shownum = '1',
      showsub = '1',
      showtitle = '1',
      fontsize = '',
    } = toJS(meetingDialog.screenParams);
    const demo = meetingId == '' ? 'demo' : meetingId;

    // let {allCreateDatas} = toJS(meetingDialog.dialogStatus)
    // let {screenParams} = allCreateDatas
    // let {bgcolor = '', bgimg = '', fontcolor = '', showdep = '1', showhead = '1', shownum = '1', showsub = '1', fontsize = ''} = screenParams
    bgcolor = bgcolor.split('#')[1]
    fontcolor = fontcolor.split('#')[1]
    bgimg = bgimg == '' ? 0 : bgimg
    let bgimgLoadlinkTemp = ''; 
    if(bgimgLoadlink){
      const bgimgLoadlinkArr = bgimgLoadlink.split('fileid=')
      bgimgLoadlinkTemp = bgimgLoadlinkArr[bgimgLoadlinkArr.length - 1]
    }
    bgimgLoadlinkTemp = bgimgLoadlinkTemp == ''?-1:bgimgLoadlinkTemp;
    window.open(`/spa/meeting/static/index.html#/main/meeting/screen/${demo}/${bgcolor}/${fontcolor}/${showdep}/${showhead}/${shownum}/${showsub}/${fontsize}/${bgimgLoadlinkTemp}/${showtitle}`)
  }

  doDelete = () => {
    const {meetingId, isSingle} = this.props
    let {doDelete, doInit,dialogStatus} = this.props.meetingDialog;
    dialogStatus.submitLoading = true;
    confirm({
      content: getLabel(127574, '确定删除吗？'),
      onOk: () => {
        doDelete({
            meetingid: meetingId,
          }, () => {
            doInit('', false, '', () => {
              message.success(`${getLabel(30700,'操作成功')}`);
              dialogStatus.submitLoading = false;
              this.doClose()
            });
            isSingle && this.getPreview(meetingId);
          },
          () => {
            dialogStatus.submitLoading = false;
            this.setState({spinning: false});
          })
      },
      onCancel() {
        dialogStatus.submitLoading = false;
      },
    })
  }

  reSubmit2 = (type) => {//草稿页面的提交直接调用新建的提交
    const {meetingId} = this.props
    let {dialogStatus} = this.props.meetingDialog;
    dialogStatus.submitLoading = true;
    this.handleSubmit(type, meetingId);
  }


  reSubmit = () => {
    let {dialogStatus,getFormParams,customField, ecCallerVisible} = this.props.meetingDialog;
    let {allCreateDatas,serviceKeycol} = toJS(dialogStatus);
    const {meetingId} = this.props
    let formKey = meetingId ;
    let value = getFormParams(formKey);
    allCreateDatas = {...value, ...allCreateDatas};
    let params = {...allCreateDatas, meetingid: meetingId}
    let {reSubmit} = this.props.meetingDialog
    dialogStatus.submitLoading = true; // 加载
    let chkParams = ecCallerVisible ? {hrmmembers:params.hrmmembers,
      crmmembers:params.crmmembers,
      address:params.address,
      serviceitems:params.serviceitems,
      begindate:params.begindate,
      begintime:params.begintime,
      enddate:params.enddate,
      endtime:params.endtime,
      caller:allCreateDatas.caller,
      contacter:allCreateDatas.contacter,
      requestid:params.requestid,
      meetingid:params.meetingid,
      meetingtype: allCreateDatas.meetingtype,}
      : {
        hrmmembers:params.hrmmembers,
        crmmembers:params.crmmembers,
        address:params.address,
        serviceitems:params.serviceitems,
        begindate:params.begindate,
        begintime:params.begintime,
        enddate:params.enddate,
        endtime:params.endtime,
        contacter:allCreateDatas.contacter,
        requestid:params.requestid,
        meetingid:params.meetingid,
        meetingtype: allCreateDatas.meetingtype,
      };
      if(customField.length > 0){
        customField.forEach((v,index)=>{
          params[v]!=undefined?chkParams[v]=params[v]:''
        })
      }
      let servicearr = [];
      let {servicerows} = {...allCreateDatas}
      if(servicerows > 0){
        for (let key in allCreateDatas) {
          if (key.indexOf(`${serviceKeycol}_`) == 0) {
            servicearr.push(allCreateDatas[key])
          }
        }
      }
      let servicearrcopy = servicearr.filter((e, index, self) => {
        return self.indexOf(e) == index
      })
      chkParams = {...chkParams,serviceitems:servicearrcopy.join(',')}
    
      this.customMeetingChk(chkParams,allCreateDatas, 'resubmit', meetingId)
  }

  doReject = () => {
    const {meetingId} = this.props
    let {doReject} = this.props.meetingDialog

    meetingUtil.doConfirm(getLabel(24247, '你确定要退回吗'), () => {
      this.setState({spinning: true}, doReject({
        meetingid: meetingId,
      }, () => {
        this.props.setAll('', false, '')
        this.doRefesh()
        this.setState({spinning: false})
        if(this.props.isSingle) {
          window.close();
        }
      }, () => {
        this.doRefesh();
        this.setState({spinning: false});
      }))//与测试确认，点击后关闭会议弹出框
    })
  }

  doSubmit = () => {
    let {dialogStatus,getFormParams,customField} = this.props.meetingDialog;
    let {allCreateDatas,serviceKeycol} = toJS(dialogStatus);
    const {meetingId} = this.props
    let formKey = meetingId ;
    let value = getFormParams(formKey);
    allCreateDatas = {...value, ...allCreateDatas};
    let params = {...allCreateDatas, meetingid: meetingId}
    let {doSubmit} = this.props.meetingDialog;
    let chkParams = {hrmmembers:params.hrmmembers,
      crmmembers:params.crmmembers,
      address:params.address,
      serviceitems:params.serviceitems,
      begindate:params.begindate,
      begintime:params.begintime,
      enddate:params.enddate,
      endtime:params.endtime,
      requestid:params.requestid,
      meetingid:params.meetingid,
      meetingtype: allCreateDatas.meetingtype,}
      if(customField.length > 0){
        customField.forEach((v,index)=>{
          params[v]!=undefined?chkParams[v]=params[v]:''
        })
      }
      let servicearr = [];
      let {servicerows} = {...allCreateDatas}
      if(servicerows > 0){
        for (let key in allCreateDatas) {
          if (key.indexOf(`${serviceKeycol}_`) == 0) {
            servicearr.push(allCreateDatas[key])
          }
        }
      }
      let servicearrcopy = servicearr.filter((e, index, self) => {
        return self.indexOf(e) == index
      })
      chkParams = {...chkParams,serviceitems:servicearrcopy.join(',')}
    
      this.customMeetingChk(chkParams,allCreateDatas, 'doSubmit', meetingId)
  }

  doSubmit2 = () => {
    let {dialogStatus,getFormParams,customField,ecCallerVisible} = this.props.meetingDialog;
    let {allCreateDatas} = toJS(dialogStatus);
    const {meetingId} = this.props
    let formKey = meetingId ;
    let value = getFormParams(formKey);
    allCreateDatas = {...value, ...allCreateDatas};
    let params = {...allCreateDatas, meetingid: meetingId}
    let {doSubmit2} = this.props.meetingDialog;
    dialogStatus.submitLoading = true;
    let chkParams = ecCallerVisible ? {hrmmembers:params.hrmmembers,
      crmmembers:params.crmmembers,
      address:params.address,
      serviceitems:params.serviceitems,
      begindate:params.begindate,
      begintime:params.begintime,
      enddate:params.enddate,
      endtime:params.endtime,
      caller:allCreateDatas.caller,
      contacter:allCreateDatas.contacter,
      requestid:params.requestid,
      meetingid:params.meetingid,
      meetingtype: allCreateDatas.meetingtype,}
      : {
        hrmmembers:params.hrmmembers,
        crmmembers:params.crmmembers,
        address:params.address,
        serviceitems:params.serviceitems,
        begindate:params.begindate,
        begintime:params.begintime,
        enddate:params.enddate,
        endtime:params.endtime,
        contacter:allCreateDatas.contacter,
        requestid:params.requestid,
        meetingid:params.meetingid,
        meetingtype: allCreateDatas.meetingtype,
      };
      if(customField.length > 0){
        customField.forEach((v,index)=>{
          params[v]!=undefined?chkParams[v]=params[v]:''
        })
      }

     this.customMeetingChk(chkParams,allCreateDatas, 'doSubmit2', meetingId)
  }

  cancelMeeting = () => {
    let {cancelMeeting} = this.props.meetingDialog;
    meetingUtil.doConfirm(getLabel(20117, '你确定要取消会议吗？'),()=> {
      this.setState({spinning: true});
      cancelMeeting({
        meetingid: this.props.meetingId,
      }, () => {
        message.success(`${getLabel(30700,'操作成功')}`);
        this.props.isSingle && this.getPreview(this.props.meetingId);
        this.doClose()
      })
    })
  }

  copy = () => {
    const {meetingId} = this.props
    let {copy} = this.props.meetingDialog
    copy({
      meetingid: meetingId,
    }, (id) => {
      if(this.props.isSingle){
        const redirectHref = window.location.href.replace(`=${meetingId}`,`=${id}`)
        window.location.href=redirectHref;
      }
      //在create.js中的tableEditChange方法中会议服务/会议议程只有在改变的时候才会同步议程服务数据到store中
      //如果直接打开正常会议然后直接复制,那么服务/议程数据是不会同步的,所以这里在进行同步一次
      this.sysncServiceTopic()
      this.props.setAll(id, true, 'edit')
      this.edit();
      this.doRefesh()
    })
  }


  sysncServiceTopic = () => {
    let { dialogStatus, getMeetingTopicField, getMeetingServiceField, saveFields } = this.props.meetingDialog;
    let { tabTopic, tabService, allCreateDatas} = toJS(dialogStatus);
    let servicerows = '';
    let topicrows = '';
    let each = {};
    let alldatas = {};
    if(tabTopic.datas){
      tabTopic.datas.forEach((element, index) => {
        each = mapKeys(element, (value, key) => {
          return key + '_' + (index + 1)
        })
        alldatas = {...alldatas, ...each}
      })
      topicrows = tabTopic.datas.length;
      alldatas = {
        ...alldatas,
        topicrows: topicrows || 0,
      }
      getMeetingTopicField(tabTopic.datas)
    }

    if(tabService.datas){
      tabService.datas.forEach((element, index) => {
        each = mapKeys(element, (value, key) => {
          return key + '_' + (index + 1)
        })
        alldatas = {...alldatas, ...each}
      })
      servicerows = tabService.datas.length;
      alldatas = {
        ...alldatas,
        servicerows: servicerows || 0,
      }
      getMeetingServiceField(tabService.datas)
    }
      
    allCreateDatas = {...allCreateDatas, ...alldatas}
    saveFields(allCreateDatas)
  }

  getPreview = (meetingId) => {
    let {changeNewForm, getPreview, doNewForm} = this.props.meetingDialog
    this.setState({spinning: true}, getPreview({meetingid: meetingId}, (conditioninfo) => {
      conditioninfo && this.setState({spinning: false}, doNewForm(meetingId, (form) => {
        form.initFormFields(conditioninfo)
        changeNewForm(true)
      }))
      !conditioninfo && this.setState({spinning: false})
    }))
  }

  //这里改造一下，传start和end，只取这其外的字段。
  range = (start, end) => {
    const result = [];
    for (let i = start; i < end; i++) {
      result.push(i);
    }
    return result;
  }

  rangeH = (start, end) => {
    const result = [];
    for (let i = 0; i < start; i++) {
      result.push(i);
    }
    for (let j = end; j < 24; j++) {
      result.push(j);
    }
    return result;
  }

  rangeM = (start, end) => {
    const result = [];
    for (let i = 0; i < start; i++) {
      result.push(i);
    }
    for (let j = end; j < 60; j++) {
      result.push(j);
    }
    return result;
  }

  dateFormat =(fmt, date)=> {
    let ret;
    const opt = {
        "Y+": date.getFullYear().toString(),        // 年
        "m+": (date.getMonth() + 1).toString(),     // 月
        "d+": date.getDate().toString(),            // 日
        "H+": date.getHours().toString(),           // 时
        "M+": date.getMinutes().toString(),         // 分
        "S+": date.getSeconds().toString()          // 秒
        // 有其他格式化字符需求可以继续添加，必须转化成字符串
    };
    for (let k in opt) {
        ret = new RegExp("(" + k + ")").exec(fmt);
        if (ret) {
            fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
        };
    };
    return fmt;
}

  overMeeting = () => {
    let {overMeeting} = this.props.meetingDialog;
    const {meetingId} = this.props;
    let { dialogStatus,overMeetingDialogVisiable,setState } = this.props.meetingDialog;
    setState({overMeetingDialogVisiable:true})
  }

  changeMeeting = () => {
    let {doInit, form, getCreate, changePreviewMeetingTab,doNewForm,changeNewForm} = this.props.meetingDialog
    const {meetingId, meetingDate=''} = this.props
    let dateToMoment
    if(meetingDate == ''){
      dateToMoment = moment(new Date())
    }else{
      dateToMoment = moment(meetingDate)
    }
    this.props.setType('change')
    changePreviewMeetingTab(1)
    doInit('change', true, meetingId, getCreate('change', {
      isChange: 1,
      meetingDate: dateToMoment.format('YYYY-MM-DD'),
      meetingid: meetingId
    }, (conditioninfo) => {
      this.setState({spinning: false}, doNewForm(meetingId,(form)=>{
        form.initFormFields(conditioninfo)
        changeNewForm(true)}))
    }))
  }

  cancelIntvl = () => {
    let {cancelIntvl} = this.props.meetingDialog;
    const {meetingId} = this.props;
    meetingUtil.doConfirm(getLabel(383340, '确定要取消该周期会议吗'), () => {
      cancelIntvl({
        meetingid: meetingId,
      }, () => {
        message.success(`${getLabel(30700,'操作成功')}`);
        this.props.isSingle && this.getPreview(this.props.meetingId);
        this.doClose()
      })
    })
  }

  onStopIntvl = () => {
    let {onStopIntvl} = this.props.meetingDialog;
    const {meetingId} = this.props;
    meetingUtil.doConfirm(getLabel(386204, ' 确定要停止该周期会议吗 '), () => {
      onStopIntvl({
        meetingid: meetingId,
      }, () => {
        message.success(`${getLabel(30700,'操作成功')}`);
        this.props.isSingle && this.getPreview(this.props.meetingId);
        this.doClose()
      })
    })
  }

  onChgIntvl = () => {//提前结束重复会议
    const {meetingId, meetingRepeat, meetingDialog} = this.props;
    const {dialogStatus} = meetingDialog;
    const {tabbase} = toJS(dialogStatus);

    const endRepeatStore = this.props.meetingStoreMap.getMapStore(2);//动态获取提前结束重复会议的store

    let advanceEnddate = '', advanceBegindate = '';
    tabbase.datas.forEach(e => {
      e && e.items && e.items.forEach(item => {
        if (item.domkey[0] == 'repeatbegindate') {
          advanceBegindate = item.value;
          meetingRepeat.setState({repeatbegindate: item.value});
        }
        if (item.domkey[0] == 'repeatenddate') {
          advanceEnddate = item.value;
          meetingRepeat.setState({repeatenddate: item.value, enddate: item.value});
        }
      })
    });

    meetingUtil.doConfirm('确定提前结束重复会议？', ()=> {
      endRepeatStore.advanceModal(true, {//提前结束重复会议调用endRepeatStore的方法
        meetingid: meetingId,
        repeatenddate: advanceEnddate,
        repeatbegindate: advanceBegindate,
      });
      this.props.isSingle && this.getPreview(this.props.meetingId);
    })
  }

  edit = () => {
    let {deleteForm} = this.props.meetingDialog;
    const {meetingId} = this.props;
    this.props.setType('edit');
    deleteForm(meetingId);
  }

  meetingToGovern = () => {
    const RadioGroup = Radio.Group;
    let {getCategoryConditions,cataconditions,cateStr,categoryDefault} = this.props.meetingDialog;
    const {meetingId} = this.props;
    // let cataconditions = '';
    // let cateStr = '';
    // let categoryDefault = '';
    let params = {'type':'8','meetingid':meetingId}
    getCategoryConditions(params).then((result) =>{
      cataconditions = result.categoryconditions;
      let contentDom = null;
    if(cataconditions){
      if(cataconditions.length == 1){
        if(cataconditions[0].isgray){
          return message.error(`${getLabel(523841,'没有可用的督办类型。')}`);
        }else{
          contentDom = (
            <div>
              <div>{getLabel('522947','确认执行会议转督办吗？')}</div>
            </div>
          )
          Modal.confirm({
            title: `${getLabel(131329,'信息确认')}`,
            content: contentDom,
            okText: `${getLabel(382958,'确定')}`,
            cancelText:`${getLabel(31129,'取消')}`,
            onOk: ()=> {
              if(cateStr == ''){
                cateStr =categoryDefault;
              }
                this.doMeetingToGovern({ meetingid: meetingId,categorystr:cateStr}, (result) => {
              })
            }
          })
        }
      }else{
        let canusecount = 0;
        let canuseCs=[];
        cataconditions.forEach(item =>{
          let isgray = item.isgray;
          if(!isgray){
            canusecount++;
            canuseCs.push(item);
          } 
       })
       if(canuseCs.length>0){
        categoryDefault = canuseCs[0].id;
       }
          if(canusecount <1){
            return message.error(`${getLabel(523841,'没有可用的督办类型。')}`);
          }else{
            let msg = [];
            const radioStyle = {
              display: 'block',
              height: '30px',
              lineHeight: '30px',
            };
            cataconditions.forEach(item =>{
              let name = item.name;
              msg.push(
                <Radio ecId={`${this && this.props && this.props.ecId || ''}_Radio@1l4xqz@${item.id}`} key={item.id} disabled={item.isgray} value={item.id} defaultChecked={true} style={radioStyle} >{name}</Radio>,
              );
            })
            contentDom = (
              <div>
                <WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@qt1b6t`} height='150px'>
                <div>{getLabel('522951','请选择一个督办类型：')}</div>
                <RadioGroup ecId={`${this && this.props && this.props.ecId || ''}_RadioGroup@nsy5g5`} defaultValue={categoryDefault} onChange={e =>{
                    cateStr = e.target.value
                }} >
                {msg}
                </RadioGroup>
                </WeaNewScroll>
              </div>
            )
            Modal.confirm({
              title: `${getLabel(131329,'信息确认')}`,
              content: contentDom,
              okText: `${getLabel(382958,'确定')}`,
              cancelText:`${getLabel(31129,'取消')}`,
              onOk: ()=> {
                if(cateStr == ''){
                  cateStr =categoryDefault;
                }
                  this.doMeetingToGovern({ meetingid: meetingId,categorystr:cateStr}, (result) => {
                })
              }
            })
          }
      }
    }
    })
    
  }

  meetingDecisionToGovern = () => {
    const RadioGroup = Radio.Group;
    let {getCategoryDecisionConditions,cataDecisionconditions,cateDecisionStr,categoryDecisionDefault} = this.props.meetingDialog;
    const {meetingId} = this.props;
    let params = {'type':'9','meetingid':meetingId}
    getCategoryDecisionConditions(params).then((result) =>{
      cataDecisionconditions = result.categoryconditions;
      let contentDom = null;
      if(cataDecisionconditions.length == 1){
        if(cataDecisionconditions[0].isgray){
          return message.error(`${getLabel(523841,'没有可用的督办类型。')}`);
        }
        contentDom = (
          <div>
            <div>{getLabel('523330','确认执行会议决议转督办吗？')}</div>
          </div>
        )
        Modal.confirm({
          title: `${getLabel(131329,'信息确认')}`,
          content: contentDom,
          okText: `${getLabel(382958,'确定')}`,
          cancelText:`${getLabel(31129,'取消')}`,
          
          onOk: ()=> {
            if(cateDecisionStr == ''){
              cateDecisionStr =categoryDecisionDefault;
            }
            this.doMeetingDecisionToGovern({ meetingid: meetingId,categorystr:cateDecisionStr}, (result) => {
            })
          }
        })
      }else{
        let canusecount = 0;
        let canuseCs=[];
        cataDecisionconditions.forEach(item =>{
          let isgray = item.isgray;
          if(!isgray) {
            canusecount++;
            canuseCs.push(item);
          };
        })
        if(canuseCs.length>0){
          categoryDecisionDefault = canuseCs[0].id;
         }
        if(canusecount <1){
          return message.error(`${getLabel(523841,'没有可用的督办类型。')}`);
        }else{
          let msg = [];
          const radioStyle = {
            display: 'block',
            height: '30px',
            lineHeight: '30px',
          };
          cataDecisionconditions.forEach((item, index) =>{
            let name = item.name;
            msg.push(
              <Radio ecId={`${this && this.props && this.props.ecId || ''}_Radio@w2nhtu@governdecisionCondition_${index}`} key={item.id} disabled={item.isgray} value={item.id} defaultChecked={true} style={radioStyle} >{name}</Radio >
            );
          })
          contentDom = (
            <div>
              <WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@5t7fiw`} height='150px'>
              <div>{getLabel('522951','请选择一个督办类型：')}</div>
              <RadioGroup ecId={`${this && this.props && this.props.ecId || ''}_RadioGroup@0iap3u`} defaultValue={categoryDecisionDefault} onChange={e =>{
                  cateDecisionStr = e.target.value
              }} >
              {msg}
              </RadioGroup></WeaNewScroll>
            </div>
          )
          Modal.confirm({
            title: `${getLabel(131329,'信息确认')}`,
            content: contentDom,
            okText: `${getLabel(382958,'确定')}`,
            cancelText:`${getLabel(31129,'取消')}`,
            
            onOk: ()=> {
              if(cateDecisionStr == ''){
                cateDecisionStr =categoryDecisionDefault;
              }
              this.doMeetingDecisionToGovern({ meetingid: meetingId,categorystr:cateDecisionStr}, (result) => {
              })
            }
          })
        }
      }
    })
  }

  doMeetingToGovern =(params)=>{
    API_LIST.meetingToGovern(params).then((result) => {
      if(result.status == '1'){
        message.success(`${getLabel(30700,'操作成功')}`);
      }else{
        message.error(`${getLabel(523907,'字段配置有误，数据转换失败!')}`);
      }
      //this.doClose();
    });
  }

  doMeetingDecisionToGovern =(params)=>{
    API_LIST.meetingDecisionToGovern(params).then((result) => {
      if(result.status == '1'){
        message.success(`${getLabel(30700,'操作成功')}`);
      }else{
        message.error(`${getLabel(523907,'字段配置有误，数据转换失败!')}`);
      }
      //this.doClose();
    });
  }

  decisionGoBack = ()=>{
    const {meetingId} = this.props;
    this.props.setAll(meetingId, true, 'preview');
    this.doRefesh();
  }

  trimLine = (date) => {
    if(typeof date === 'string') {
      return date.replace(/-/g, '/');
    }
    return date;
  }

  //提交会议决议
  decisionSubmit = () => {
    const {meetingDialog} = this.props;
    const _this = this;
    let canSave = true;
    if(_this.refs.meetingDecisionDialog.wrappedInstance.refs.decisionTableEdit.refs.edit.doRequiredCheck().pass){
      canSave = true;
    }else{
      canSave = false;
    }
    const {meetingId, meetingType, date, type, meetingPerson} = this.props;
    const {tabDecision} = toJS(meetingDialog.dialogStatus);
    // let = this.refs.meetingDecisionDialog && this.refs.meetingDecisionDialog.returnState();
    const {
      decision = '',
      decisiondoc = [],//文档
      decisioncrmids = [],//客户
      decisionprjids = [],//项目
      decisiontskids = [],//任务
      decisionwfids = [],//流程
      decisionatchids = [],//附件
      datas = [],//下面的table
    } = toJS(meetingDialog.decisionStatus);
    let each = {};
    let eachvalue = {};
    let alldatas = {};
    let params = {};
    let validDate=[]
    datas.length > 0 && datas.forEach((element, index) => {
      if(moment(new Date(this.trimLine(element['enddate']))).format("YYYY-MM-DD HH:mm:ss")>moment(new Date(this.trimLine(element['begindate']))).format("YYYY-MM-DD HH:mm:ss")){
        validDate.push(1)
      }else{
        validDate.push(0)
      }
      each = mapKeys(element, (value, key) => {
        return key + '_' + (index + 1)
      })
      eachvalue = mapValues(each, (e, i) => {
        return {
          value: e,
          name: i,
        }
      })
      alldatas = {...alldatas, ...eachvalue}
    })
    let msg=''
    for(var i=0;i<validDate.length;i++){
      if(validDate[i]==0){
        msg+=(i+1)+"、"
      }
    }
    let copyData = alldatas;
    if (copyData.key_1) {
      delete copyData.key_1;
    }

    !canSave && Modal.warning({
      title: getLabel(127354, '警告'),
      content: getLabel(384010, '存在必填项未填写'),
    })
    if(canSave && msg.length){
      let index = msg.lastIndexOf('、')
      msg = msg.substr(0,index);
      Modal.warning({
        title: getLabel(127354, '警告'),
        content: getLabel(15323, '第')+msg+getLabel(514173, '行决议开始时间应小于结束时间'),
      })
      canSave=false
    }
    if (canSave) {
      //附件的没写
      if (decisionatchids.length > 0) {
        let arr = []
        decisionatchids.forEach((element, index) => {
          arr.push(element['fileid'])
        })
        params.decisionatchids = arr.join(',')
      }
      if (decision) {
        params.decision = decision
      }
      if (decisionwfids.length > 0) {
        let arr = []
        decisionwfids.forEach((element, index) => {
          arr.push(element['id'])
        })
        params.decisionwfids = arr.join(',')
      }
      if (decisiontskids.length > 0) {
        let arr = []
        decisiontskids.forEach((element, index) => {
          arr.push(element['id'])
        })
        params.decisiontskids = arr.join(',')
      }
      if (decisionprjids.length > 0) {
        let arr = []
        decisionprjids.forEach((element, index) => {
          arr.push(element['id'])
        })
        params.decisionprjids = arr.join(',')
      }
      if (decisiondoc.length > 0) {
        let arr = []
        decisiondoc.forEach((element, index) => {
          arr.push(element['id'])
        })
        params.decisiondoc = arr.join(',')
      }
      if (decisioncrmids.length > 0) {
        let arr = []
        decisioncrmids.forEach((element, index) => {
          arr.push(element['id'])
        })
        params.decisioncrmids = arr.join(',')
      }
      alldatas = {
        ...alldatas, decisionrows: {
          value: datas.length,
          name: 'decisionrows'
        }
      }

      for (let key in alldatas) {
        params[key] = alldatas[key]['value']
      }
      params.meetingid = meetingId
      params.meetingType = meetingType
      params.date = date
      params.type = type
      params.meetingPerson = meetingPerson
      meetingDialog.decisionSubmit(params, () => {
        meetingDialog.changePreviewMeetingTab('5');
        this.props.setAll(meetingId, true, 'preview');
        this.doRefesh();
        // meetingDialog.getTabDecisionTable(tabDecision.list.sessionkey);
        // this.props.setAll(meetingId, true, 'preview');
        // this.doRefesh();
        // this.refs.preview && this.refs.preview.wrappedInstance.onChange('5'); //会议决议保存后，应该直接到参看会议的会议决议页面，并且页面要刷新
      })
    }
  }

  //保存会议决议
  decisionSave = () => {
    const {meetingDialog} = this.props;
    const _this = this;
    let canSave = true;
    if(_this.refs.meetingDecisionDialog.wrappedInstance.refs.decisionTableEdit.refs.edit.doRequiredCheck().pass){
      canSave = true;
    }else{
      canSave = false;
    }
    const {meetingId, meetingType, date, type, meetingPerson} = this.props;
    // let = this.refs.meetingDecisionDialog && this.refs.meetingDecisionDialog.returnState();
    const {
      decision = '',
      decisiondoc = [],//文档
      decisioncrmids = [],//客户
      decisionprjids = [],//项目
      decisiontskids = [],//任务
      decisionwfids = [],//流程
      decisionatchids = [],//附件
      datas = [],//下面的table
    } = toJS(meetingDialog.decisionStatus);
    let each = {};
    let eachvalue = {};
    let alldatas = {};
    let params = {};
    let validDate = []
    datas.length > 0 && datas.forEach((element, index) => {
      if(moment(new Date(this.trimLine(element['enddate']))).format("YYYY-MM-DD HH:mm:ss")>moment(new Date(this.trimLine(element['begindate']))).format("YYYY-MM-DD HH:mm:ss")){
        validDate.push(1)
      }else{
        validDate.push(0)
      }
      each = mapKeys(element, (value, key) => {
        return key + '_' + (index + 1)
      })
      eachvalue = mapValues(each, (e, i) => {
        return {
          value: e,
          name: i,
        }
      })
      alldatas = {...alldatas, ...eachvalue}
    })
    let msg=''
    for(var i=0;i<validDate.length;i++){
      if(validDate[i]==0){
        msg+=(i+1)+"、"
      }
    }
   
    let copyData = alldatas;
    if (copyData.key_1) {
      delete copyData.key_1;
    }
    
    !canSave && Modal.warning({
      title: getLabel(127354, '警告'),
      content: getLabel(384010, '存在必填项未填写'),
    })
    if(canSave && msg.length){
      let index = msg.lastIndexOf('、')
      msg = msg.substr(0,index);
      Modal.warning({
        title: getLabel(127354, '警告'),
        content: getLabel(15323, '第')+msg+getLabel(514173, '行决议开始时间应小于结束时间'),
      })
      canSave=false
    }
    if (canSave) {
      //附件的没写
      if (decisionatchids.length > 0) {
        let arr = []
        decisionatchids.forEach((element, index) => {
          arr.push(element['fileid'])
        })
        params.decisionatchids = arr.join(',')
      }
      if (decision) {
        params.decision = decision
      }
      if (decisionwfids.length > 0) {
        let arr = []
        decisionwfids.forEach((element, index) => {
          arr.push(element['id'])
        })
        params.decisionwfids = arr.join(',')
      }
      if (decisiontskids.length > 0) {
        let arr = []
        decisiontskids.forEach((element, index) => {
          arr.push(element['id'])
        })
        params.decisiontskids = arr.join(',')
      }
      if (decisionprjids.length > 0) {
        let arr = []
        decisionprjids.forEach((element, index) => {
          arr.push(element['id'])
        })
        params.decisionprjids = arr.join(',')
      }
      if (decisiondoc.length > 0) {
        let arr = []
        decisiondoc.forEach((element, index) => {
          arr.push(element['id'])
        })
        params.decisiondoc = arr.join(',')
      }
      if (decisioncrmids.length > 0) {
        let arr = []
        decisioncrmids.forEach((element, index) => {
          arr.push(element['id'])
        })
        params.decisioncrmids = arr.join(',')
      }
      alldatas = {
        ...alldatas,
        decisionrows: {
          value: datas.length,
          name: 'decisionrows'
        }
      }

      for (let key in alldatas) {
        params[key] = alldatas[key]['value']
      }
      params.meetingid = meetingId
      params.meetingType = meetingType
      params.date = date
      params.type = type
      params.meetingPerson = meetingPerson

      meetingDialog.decisionSave(params, () => {
        meetingDialog.changePreviewMeetingTab('5');
        this.props.setAll(meetingId, true, 'preview');
        this.doRefesh();
        // this.props.setAll(meetingId, true, 'preview');
        // this.refs.preview && this.refs.preview.wrappedInstance.onChange('5'); //会议决议保存后，应该直接到参看会议的会议决议页面，并且页面要刷新
      })
    }
  }

  onShowDecision = () => {
    const {meetingId} = this.props;
    let {getDecisionDataNew} = this.props.meetingDialog;
    getDecisionDataNew(meetingId, () => {
      this.props.setAll(meetingId, true, 'decision');
      this.setState({spinning: false});
    })
  }

  doAddressTip = (allCreateDatas, result, type, meetingId) => {
    let that = this
    let {dialogStatus} = this.props.meetingDialog;
    let conMsg = result.address.msg.map((e) => {
      return <div>{`[${e}]`}{getLabel(127867, '冲突')}</div>
    })
    let conflictMsg = (
      <div style={{marginRight: '-20px'}}>
        <WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@bpppbq`} height='80px'>
          {conMsg}
          {
            <span>{getLabel(384774, '是否继续申请？')}</span>
          }
        </WeaNewScroll>
      </div>
    )
    if (result.address.cansub == true) {//冲突了是否可提交，true是可提交
      confirm({
        className: 'room-conflict-tip',
        title: getLabel(384773, '会议室冲突'),
        content: conflictMsg,
        onOk() {
          if (!result.member.chkstatus) {
            that.doMemberTip(allCreateDatas, result, type, meetingId)
          } else if (!result.wpMember.chkstatus) {
            that.doWPMemberTip(allCreateDatas, result, type, meetingId)
          } else if (!result.service.chkstatus) {
            that.doServiceTip(allCreateDatas, result, type, meetingId)
          } else {
            //走接口
            that.doCreateSubmit(allCreateDatas, type, meetingId)
          }
        },
        onCancel() {
          dialogStatus.submitLoading = false;
          dialogStatus.saveLoading = false;
        },
      })
    } else {
      errorModal({
        className: 'room-conflict-tip-noSubmit',
        title: getLabel(32875, '会议室冲突不能提交'),
        content: conMsg,
        onOk() {
          dialogStatus.saveLoading = false;
          dialogStatus.submitLoading = false;
        },
        onCancel() {
          dialogStatus.saveLoading = false;
          dialogStatus.submitLoading = false;
        },
      })
    }
  }

  doMemberTip = (allCreateDatas, result, type, meetingId) => {
    let that = this
    let conflictMsg = '';
    let {dialogStatus} = this.props.meetingDialog;
    let cont = result.member.msg.hrms.map((e) => {
      return <div>{e}</div>
    })
    let contcrms = result.member.msg.crms.map((e) => {
      return <div>{e}</div>
    })
    conflictMsg = (
      <div style={{marginRight: '-20px'}}>
        <WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@7kb4py`} height='80px'>
          {
            result.member.msg.hrms.length > 0 ? getLabel(30042, '人员') + '：' : ''
          }
          {cont}
          {
            result.member.msg.crms.length > 0 ? getLabel(136, '客户') + '：' : ''
          }
          {contcrms}
          {
            result.member.cansub == true ?
              <span>{getLabel(384774, '是否继续申请？')}</span>
              :
              <span>{getLabel(32874, '不能提交！')}</span>
          }
        </WeaNewScroll>
      </div>
    )
    if (result.member.cansub == true) {
      confirm({
        className: 'participants-conflict-tip',
        title: getLabel(384775, '参会人员冲突'),
        content: conflictMsg,
        onOk() {
          if (!result.wpMember.chkstatus) {
            that.doWPMemberTip(allCreateDatas, result, type, meetingId)
          }else if (!result.service.chkstatus) {
            that.doServiceTip(allCreateDatas, result, type, meetingId)
          } else {
            //走提交接口
            that.doCreateSubmit(allCreateDatas, type, meetingId)
          }
        },
        onCancel() {
          dialogStatus.saveLoading = false;
          dialogStatus.submitLoading = false;
        },
      })
    } else {
      errorModal({
        className: 'participants-conflict-tip-noSubmit',
        title: getLabel(523897, '参会人员冲突不能提交'),
        content: conflictMsg,
        onOk() {
          dialogStatus.saveLoading = false;
          dialogStatus.submitLoading = false;
        },
        onCancel() {
          dialogStatus.saveLoading = false;
          dialogStatus.submitLoading = false;
        },
      })
    }

  }

  doWPMemberTip = (allCreateDatas, result, type, meetingId) => {
    let that = this
    let conflictMsg = '';
    let {dialogStatus} = this.props.meetingDialog;
    let cont = result.wpMember.msg.hrms.map((e) => {
      return <div>{e}</div>
    })
    conflictMsg = (
      <div style={{marginRight: '-20px'}}>
        <WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@zhb2eb`} height='80px'>
          {
              result.wpMember.cansub == true && result.wpMember.msg.hrms.length > 0 ? getLabel(517068, '以下参会人员存在日程冲突，确定要继续保存吗？') : ''
          }
          {cont}
        </WeaNewScroll>
      </div>
    )
    if (result.wpMember.cansub == true) {
      confirm({
        className: 'participants-conflict-tip',
        title: getLabel(516921, '参会人日程冲突提醒'),
        content: conflictMsg,
        onOk() {
           if (!result.service.chkstatus) {
            that.doServiceTip(allCreateDatas, result, type, meetingId)
          } else {
            //走提交接口
            that.doCreateSubmit(allCreateDatas, type, meetingId)
          }
        },
        onCancel() {
          dialogStatus.saveLoading = false;
          dialogStatus.submitLoading = false;
        },
      })
    } else {
      errorModal({
        className: 'participants-conflict-tip-noSubmit',
        title: getLabel(516987, '参会人日程冲突不能保存'),
        content: conflictMsg,
        onOk() {
          dialogStatus.saveLoading = false;
          dialogStatus.submitLoading = false;
        },
        onCancel() {
          dialogStatus.saveLoading = false;
          dialogStatus.submitLoading = false;
        },
      })
    }

  }


  doServiceTip = (allCreateDatas, result, type, meetingId) => {
    let that = this;
    let {dialogStatus} = this.props.meetingDialog;
    let conMsg = result.service.msg.map((e) => {
      return <div>{`${e}`}{getLabel(127867, '冲突')}</div>
    })
    let conflictMsg = (
      <div style={{marginRight: '-20px'}}>
        <WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@so10qw`} height='80px'>
          {conMsg}
          {
            <span>{getLabel(384774, '是否继续申请？')}</span>
          }
        </WeaNewScroll>
      </div>
    )
    if (result.service.cansub == true) {
      confirm({
        className: 'server-conflict-tip',
        title: getLabel(384777, '会议服务冲突'),
        content: conflictMsg,
        onOk() {
          //走提交接口
          that.doCreateSubmit(allCreateDatas, type, meetingId)
        },
        onCancel() {
          dialogStatus.saveLoading = false;
          dialogStatus.submitLoading = false;
        },
      })
    } else {
      errorModal({
        className: 'server-conflict-tip-noSubmit',
        title: getLabel(384778, '会议服务冲突不能提交'),
        content: conMsg,
        onOk() {
          dialogStatus.saveLoading = false;
          dialogStatus.submitLoading = false;
        },
        onCancel() {
          dialogStatus.saveLoading = false;
          dialogStatus.submitLoading = false;
        },
      })
    }
  }

  chkMeeting = (allCreateDatas, type, meetingId) => {
    let {dialogStatus,customField, ecCallerVisible} = this.props.meetingDialog;
    let params = {...allCreateDatas, meetingid: meetingId}
    let that = this
    let {isInterval} = this.props;
    if (isInterval) {
      const repeatStrategy = params['repeatStrategy']
      repeatStrategy && repeatStrategy!='0' ? API_LIST.chkRepeatMeeting({begindate:params.repeatbegindate}).then((result) => {
        if(result.chkstatus){
          //周期会议直接走提交接口
          confirm({
            title: getLabel(15172, '系统提示'),
            content: getLabel(126907,'周期会议可能与现有会议存在会议室冲突')+getLabel(126908,' 请注意查看流程提醒！'),
            onOk() {
              //走提交接口
              that.doCreateSubmit(allCreateDatas, type, meetingId)
            },
            onCancel() {
              dialogStatus.saveLoading = false;
              dialogStatus.submitLoading =false;
            },
          })
        }else{
          errorModal({
            title: getLabel(15172, '系统提示'),
            content: result.msg,
            onOk() {
              dialogStatus.saveLoading = false;
              dialogStatus.submitLoading = false;
            },
            onCancel() {
              dialogStatus.saveLoading = false;
              dialogStatus.submitLoading = false;
            },
          })
        }
      })://周期会议直接走提交接口
      confirm({
        title: getLabel(15172, '系统提示'),
        content: getLabel(126907,'周期会议可能与现有会议存在会议室冲突')+getLabel(126908,' 请注意查看流程提醒！'),
        onOk() {
          //走提交接口
          that.doCreateSubmit(allCreateDatas, type, meetingId)
        },
        onCancel() {
          dialogStatus.saveLoading = false;
          dialogStatus.submitLoading =false;
        },
      })
      
    }else{
      let chkParams = ecCallerVisible ? {hrmmembers:params.hrmmembers,
        crmmembers:params.crmmembers,
        address:params.address,
        serviceitems:params.serviceitems,
        begindate:params.begindate,
        begintime:params.begintime,
        enddate:params.enddate,
        endtime:params.endtime,
        caller:allCreateDatas.caller,
        contacter:allCreateDatas.contacter,
        requestid:params.requestid,
        meetingid:params.meetingid,
        meetingtype: allCreateDatas.meetingtype,}
        : {
          hrmmembers:params.hrmmembers,
          crmmembers:params.crmmembers,
          address:params.address,
          serviceitems:params.serviceitems,
          begindate:params.begindate,
          begintime:params.begintime,
          enddate:params.enddate,
          endtime:params.endtime,
          contacter:allCreateDatas.contacter,
          requestid:params.requestid,
          meetingid:params.meetingid,
          meetingtype: allCreateDatas.meetingtype,
        };
        if(customField.length > 0){
          customField.forEach((v,index)=>{
            params[v]!=undefined?chkParams[v]=params[v]:''
          })
        }

        this.customMeetingChk(chkParams,allCreateDatas, type, meetingId)
        
        /*API_LIST.customMeetingChk(chkParams).then((result) => {
          if(result.chkstatus){
            API_LIST.chkMeeting(chkParams).then((result) => {
              if (!result.address.chkstatus) {
                this.doAddressTip(allCreateDatas, result, type, meetingId)
              } else if (!result.member.chkstatus) {
                this.doMemberTip(allCreateDatas, result, type, meetingId)
              } else if (!result.service.chkstatus) {
                this.doServiceTip(allCreateDatas, result, type, meetingId)
              } else {
                //走提交接口
                this.doCreateSubmit(allCreateDatas, type, meetingId)
              }
            })
          }else{
            if(result.isForbidden){
              errorModal({
                title: getLabel(15172, '系统提示'),
                content: result.msg,
                onOk() {
                  dialogStatus.saveLoading = false;
                  dialogStatus.submitLoading = false;
                },
                onCancel() {
                  dialogStatus.saveLoading = false;
                  dialogStatus.submitLoading = false;
                },
              })
            }else{
              let _that = this;
              let conflictMsg = (
                <div style={{marginRight: '-20px'}}>
                  <WeaNewScroll height='80px'>
                    {result.msg}
                    {
                      <span>{getLabel(384774, '是否继续申请？')}</span>
                    }
                  </WeaNewScroll>
                </div>
              )
              confirm({
                title: getLabel(15172, '系统提示'),
                content: conflictMsg,
                onOk() {
                  //走提交接口
                  API_LIST.chkMeeting(chkParams).then((result) => {
                    if (!result.address.chkstatus) {
                      _that.doAddressTip(allCreateDatas, result, type, meetingId)
                    } else if (!result.member.chkstatus) {
                      _that.doMemberTip(allCreateDatas, result, type, meetingId)
                    } else if (!result.service.chkstatus) {
                      _that.doServiceTip(allCreateDatas, result, type, meetingId)
                    } else {
                      //走提交接口
                      _that.doCreateSubmit(allCreateDatas, type, meetingId)
                    }
                  })
                },
                onCancel() {
                  dialogStatus.saveLoading = false;
                  dialogStatus.submitLoading =false;
                },
              })
            }
          }
        })*/
    }
    
  }

  customMeetingChk = (chkParams, allCreateDatas, type, meetingId)=>{
    let {reSubmit,doSubmit,doSubmit2} = this.props.meetingDialog;
    let {dialogStatus,getFormParams,customField} = this.props.meetingDialog;
    API_LIST.customMeetingChk(chkParams).then((result) => {
      if(result.chkstatus){
        API_LIST.chkMeeting(chkParams).then((result) => {
          if (!result.address.chkstatus) {
            this.doAddressTip(allCreateDatas, result, type, meetingId)
          } else if (!result.member.chkstatus) {
            this.doMemberTip(allCreateDatas, result, type, meetingId)
          } else if (!result.wpMember.chkstatus) {
            this.doWPMemberTip(allCreateDatas, result, type, meetingId)
          } else if (!result.service.chkstatus) {
            this.doServiceTip(allCreateDatas, result, type, meetingId)
          } else {
            //走提交接口
            if(type=='resubmit'){
              this.setState({spinning: true}, reSubmit({
                meetingid: meetingId,
              }, () => {
                dialogStatus.submitLoading = false;
                this.props.setAll('', false, '')
                this.doRefesh()
                this.setState({spinning: false})
                if(this.props.isSingle) {
                  window.close();
                }
              }, () => {
                this.doRefesh();
                this.setState({spinning: false});
              }))//与测试确认，点击后关闭会议弹出框
            }else if(type=='doSubmit'){
              this.setState({spinning: true}, doSubmit({
                meetingid: meetingId,
              }, () => {
                this.props.setAll('', false, '');
                this.doRefesh();
                this.setState({spinning: false});
                if(this.props.isSingle) {
                  window.close();
                }
              }, () => {
                this.doRefesh();
                this.setState({spinning: false});
              }))//与测试确认，点击后关闭会议弹出框
            }else if(type=='doSubmit2'){
              this.setState({spinning: true}, doSubmit2({
                meetingid: meetingId,
              }, () => {
                this.props.setAll('', false, '');
                this.doRefesh();
                this.setState({spinning: false});
                if(this.props.isSingle) {
                  window.close();
                }
              }, () => {
                this.doRefesh();
                this.setState({spinning: false});
                dialogStatus.submitLoading = false;
              }))//与测试确认，点击后关闭会议弹出框
            }else{

              this.doCreateSubmit(allCreateDatas, type, meetingId)
            }
            
          }
        })
      }else{
        if(result.isForbidden){
          errorModal({
            title: getLabel(15172, '系统提示'),
            content: result.msg,
            onOk() {
              dialogStatus.saveLoading = false;
              dialogStatus.submitLoading = false;
            },
            onCancel() {
              dialogStatus.saveLoading = false;
              dialogStatus.submitLoading = false;
            },
          })
        }else{
          let _that = this;
          let conflictMsg = (
            <div style={{marginRight: '-20px'}}>
              <WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@zxnzqt`} height='80px'>
                <div>{result.msg}</div>
                {
                  <span>{getLabel(384774, '是否继续申请？')}</span>
                }
              </WeaNewScroll>
            </div>
          )
          confirm({
            title: getLabel(15172, '系统提示'),
            content: conflictMsg,
            onOk() {
              //走提交接口
              API_LIST.chkMeeting(chkParams).then((result) => {
                if (!result.address.chkstatus) {
                  _that.doAddressTip(allCreateDatas, result, type, meetingId)
                } else if (!result.member.chkstatus) {
                  _that.doMemberTip(allCreateDatas, result, type, meetingId)
                } else if (!result.wpMember.chkstatus) {
                  _that.doWPMemberTip(allCreateDatas, result, type, meetingId)
                } else if (!result.service.chkstatus) {
                  _that.doServiceTip(allCreateDatas, result, type, meetingId)
                } else {
                  if(type=='resubmit'){
                    _that.setState({spinning: true}, reSubmit({
                      meetingid: meetingId,
                    }, () => {
                      dialogStatus.submitLoading = false;
                      _that.props.setAll('', false, '')
                      _that.doRefesh()
                      _that.setState({spinning: false})
                      if(_that.props.isSingle) {
                        window.close();
                      }
                    }, () => {
                      _that.doRefesh();
                      _that.setState({spinning: false});
                    }))//与测试确认，点击后关闭会议弹出框
                  }else if(type=='doSubmit'){
                      _that.setState({spinning: true}, doSubmit({
                        meetingid: meetingId,
                      }, () => {
                        _that.props.setAll('', false, '');
                        _that.doRefesh();
                        _that.setState({spinning: false});
                        if(_that.props.isSingle) {
                          window.close();
                        }
                      }, () => {
                        _that.doRefesh();
                        _that.setState({spinning: false});
                      }))//与测试确认，点击后关闭会议弹出框
                  }else if(type=='doSubmit2'){
                        _that.setState({spinning: true}, doSubmit2({
                          meetingid: meetingId,
                        }, () => {
                          _that.props.setAll('', false, '');
                          _that.doRefesh();
                          _that.setState({spinning: false});
                          if(_that.props.isSingle) {
                            window.close();
                          }
                        }, () => {
                          _that.doRefesh();
                          _that.setState({spinning: false});
                        }))//与测试确认，点击后关闭会议弹出框
                  }else{
                          //走提交接口
                          _that.doCreateSubmit(allCreateDatas, type, meetingId)
                  }
                  
                }
              })
            },
            onCancel() {
              dialogStatus.saveLoading = false;
              dialogStatus.submitLoading =false;
            },
          })
        }
      }
    })
  }
  doCreateSubmit = (allCreateDatas, type, meetingId) => {
    this.setState({spinning: true});
    let {form, doInit, getPreview, screenParams,reSubmit,doSubmit,doSubmit2,dialogStatus,getApi_duration_start,getApi_duration_after, setServer_duration
    ,setAll_after, saveSystemPageViewLog,doNewForm,changeNewForm} = this.props.meetingDialog;
    screenParams = toJS(screenParams);
    let key = meetingId == '' ? 'create' : meetingId;
    allCreateDatas = {...allCreateDatas, ...screenParams, meetingid: meetingId};
    const that = this
    //获得接口开始时间
    getApi_duration_start();
    if (type == 'draft') {//保存也就是提交为草稿
      dialogStatus.saveLoading = true;
      allCreateDatas = this.setFilterReminder(allCreateDatas);
      API_LIST.newMeeting(allCreateDatas).then((result) => {
        allCreateDatas = {};
        dialogStatus.saveLoading = false;
        dialogStatus.submitLoading = false;
        // let param = {...allCreateDatas.screenParams, meetingid: result.meetingid}
        const param = {...screenParams, meetingid: result.meetingid};
        result.meetingid != '' && screenParams && API_LIST.saveScreenSet(param)//保存投屏设置
        result.meetingid != '' && doInit('preview', true, result.meetingid, () => {
          this.props.setAll(result.meetingid, true, 'preview');
          getPreview({meetingid: result.meetingid}, (conditioninfo) => {
            conditioninfo && this.setState({spinning: false}, doNewForm(result.meetingid, (form) => {
              form.initFormFields(conditioninfo)
              changeNewForm(true)
            }))
            !conditioninfo && this.setState({spinning: false})
            this.doRefesh()
          })
        })
      })
    } else if (type == 'submit') {//新建的提交
      dialogStatus.submitLoading = true;
      allCreateDatas = this.setFilterReminder(allCreateDatas);
      API_LIST.newMeeting(allCreateDatas).then((result) => {
        result.apiCost&&setServer_duration(result.apiCost);
        getApi_duration_after();
        allCreateDatas = {};
        dialogStatus.submitLoading = false;
        // let param = {...allCreateDatas.screenParams, meetingid: result.meetingid}
        const param = {...screenParams, meetingid: result.meetingid};
        result.meetingid != '' && screenParams && API_LIST.saveScreenSet(param)//保存投屏设置
        setAll_after();
        result.meetingid != '' && saveSystemPageViewLog({moduleType:'11'})//

        result.meetingid != '' && doInit('preview', true, result.meetingid, () => {
          this.props.setAll(result.meetingid, true, 'preview')
          getPreview({meetingid: result.meetingid}, (conditioninfo) => {
            conditioninfo && this.setState({spinning: false}, doNewForm(result.meetingid, (form) => {
              form.initFormFields(conditioninfo)
              changeNewForm(true)
            }))
            !conditioninfo && this.setState({spinning: false})
            this.doRefesh()
          })
        })
      })
    } else if (type == 'draftSave') {//查看草稿会议的提交,也就是编辑的保存
      dialogStatus.submitLoading = true;
      dialogStatus.saveLoading = true;
      allCreateDatas = this.setFilterReminder(allCreateDatas);
      API_LIST.editMeeting(allCreateDatas).then((result) => {
        // let param = {...allCreateDatas.screenParams, meetingid: result.meetingid}
        const param = {...screenParams, meetingid: result.meetingid};
        result.meetingid != '' && screenParams && API_LIST.saveScreenSet(param)//保存投屏设置
        result.meetingid != '' && doInit('preview', true, result.meetingid, () => {
          getPreview({meetingid: result.meetingid}, (conditioninfo) => {
            dialogStatus.saveLoading = false;
            dialogStatus.submitLoading = false;
            this.props.setAll(result.meetingid, true, 'preview');
            conditioninfo && this.setState({spinning: false}, doNewForm(result.meetingid, (form) => {
              form.initFormFields(conditioninfo)
              changeNewForm(true)
            }))
            !conditioninfo && this.setState({spinning: false})
            this.doRefesh()
          })
        })
      })
    } else if (type == 'change') {//会议变更
      let _this = this;
      confirm({
        title: getLabel(15172, '系统提示'),
        content: getLabel(128674,'确定要进行会议信息变更吗？提交变更后将重新通知相关参会人员'),
        onOk() {
          allCreateDatas = that.setFilterReminder(allCreateDatas);          
            API_LIST.changemeeting(allCreateDatas).then((result) => {
              
              // let param = {...allCreateDatas.screenParams, meetingid: result.meetingid}
              const param = {...screenParams, meetingid: result.meetingid};
              result.meetingid != '' && screenParams && API_LIST.saveScreenSet(param)//保存投屏设置
      
              result.meetingid != '' && doInit('preview', true, result.meetingid, () => {
                that.props.setAll(result.meetingid, true, 'preview')
                getPreview({meetingid: result.meetingid}, (conditioninfo) => {
                  conditioninfo && that.setState({spinning: false}, doNewForm(result.meetingid, (form) => {
                    form.initFormFields(conditioninfo)
                    changeNewForm(true)
                  }))
                  !conditioninfo && that.setState({spinning: false})
                  that.doRefesh()
                })
              })
            }, err => {
              _this.setState({spinning: false});
            })
          
        },
        onCancel() {
          dialogStatus.submitLoading = false;
          dialogStatus.saveLoading = false;
          that.setState({spinning: false})
        },
      })
    } else if (type == 'draftSubmit') {//查看草稿会议的提交,也就是编辑的提交
      dialogStatus.submitLoading = true;
      allCreateDatas = this.setFilterReminder(allCreateDatas);
      API_LIST.reSubmit2(allCreateDatas).then((result) => {
        // let param = {...allCreateDatas.screenParams, meetingid: result.meetingid}
        const param = {...screenParams, meetingid: result.meetingid};
        result.meetingid != '' && screenParams && API_LIST.saveScreenSet(param)//保存投屏设置
        result.meetingid != '' && doInit('preview', true, result.meetingid, () => {
          this.props.setAll(result.meetingid, true, 'preview')
          getPreview({meetingid: result.meetingid}, (conditioninfo) => {
            conditioninfo && this.setState({spinning: false}, doNewForm(result.meetingid, (form) => {
              form.initFormFields(conditioninfo)
              changeNewForm(true)
            }))
            !conditioninfo && this.setState({spinning: false})
            this.doRefesh()
            dialogStatus.submitLoading = false;
            dialogStatus.saveLoading = false;
          })
        })
      })
    } else if (type == 'resubmit') {//提交审批接口
      dialogStatus.submitLoading = true;
      this.setState({spinning: true,}, reSubmit({
        meetingid: meetingId,
      }, () => {
        this.props.setAll('', false, '')
        this.doRefesh()
        this.setState({spinning: false})
        if(this.props.isSingle) {
          window.close();
        }
      }, () => {
        this.doRefesh();
        this.setState({spinning: false});
      }))//与测试确认，点击后关闭会议弹出框
    } else if (type == 'doSubmit') {//提交审批接口
      dialogStatus.submitLoading = true;
      this.setState({spinning: true}, doSubmit({
        meetingid: meetingId,
      }, () => {
        this.props.setAll('', false, '')
        this.doRefesh()
        this.setState({spinning: false})
        if(this.props.isSingle) {
          window.close();
        }
      }, () => {
        this.doRefesh();
        this.setState({spinning: false});
      }))//与测试确认，点击后关闭会议弹出框
    } else if (type == 'doSubmit2') {//提交审批接口
      dialogStatus.submitLoading = true;
      this.setState({spinning: true}, doSubmit2({
        meetingid: meetingId,
      }, () => {
        this.props.setAll('', false, '')
        this.doRefesh()
        this.setState({spinning: false})
        if(this.props.isSingle) {
          window.close();
        }
      }, () => {
        this.doRefesh();
        this.setState({spinning: false});
        dialogStatus.submitLoading = false;
      }))//与测试确认，点击后关闭会议弹出框
    }
  }

  setFilterReminder = (params) => {// 过滤先勾选提醒方式然后取消勾选后多余的参数
    if(params && params.remindTypeNew === '') {// 未勾选提醒方式
      params = {
        ...params,
        remindImmediately: '0',
        remindBeforeStart: '0',
        remindHoursBeforeStart: '0',
        remindTimesBeforeStart: '0',
        remindBeforeEnd: '0',
        remindHoursBeforeEnd: '0',
        remindTimesBeforeEnd: '0',
      };
    }
    return params;
  }

  handleSubmit = (type = 'submit', meetingId = '', callback) => {
    let { changePreviewMeetingTab, getFormParams, dialogStatus, uploadParams, uploadKeys, setAll_start, form, topicViewActive, serviceViewActive, meetingTopicDefaultValue, meetingServiceDefaultValue,screenParams } = this.props.meetingDialog;
    dialogStatus.submitLoading = true;
    dialogStatus.saveLoading = true;
    //提交开始时间
    setAll_start();
    uploadParams = toJS(uploadParams);
    uploadKeys = toJS(uploadKeys);
    let {isInterval} = this.props;
    let {allCreateDatas, serviceKeycol, maxRepeatDate} = toJS(dialogStatus);
    let formKey = meetingId == '' ? 'create' : meetingId;
    let value = getFormParams(formKey);
    let that = this
    const {previewmeetingTab} = toJS(this.props.meetingDialog.dialogStatus);
    uploadKeys.map(key => {//上传附件字段相应的参数单独放入
      let uploadVal = [];
      uploadParams[key].datas.map(item=>{
        uploadVal.push(item.fileid)
      })
      allCreateDatas = {
        ...allCreateDatas,
        [key]: uploadVal.join(",")
      }
    })
    allCreateDatas = {...value, ...allCreateDatas};
    //allCreateDates放的是group信息,所以maxRepeatDate单独放进store
    allCreateDatas = {...allCreateDatas, maxRepeatDate: maxRepeatDate};
    
    if (type == 'draft') {
      allCreateDatas = {...allCreateDatas, method: 'save'};
    }
    if (type == 'submit') {
      allCreateDatas = {...allCreateDatas, method: ''};
    }
   
    allCreateDatas = {...allCreateDatas, isInterval: isInterval ? 1 : ''};
    let servicearr = [];
    let {servicerows} = {...allCreateDatas}
    if(servicerows > 0){
      for (let key in allCreateDatas) {
        if (key.indexOf(`${serviceKeycol}_`) == 0) {
          servicearr.push(allCreateDatas[key])
        }
      }
    }
    let servicearrcopy = servicearr.filter((e, index, self) => {
      return self.indexOf(e) == index
    })

    allCreateDatas = {...allCreateDatas, serviceitems: servicearrcopy.join(',')}

    if (previewmeetingTab == 1) {//会议信息 校验
      this.formValidate(allCreateDatas, type, meetingId, callback);
    } else if (previewmeetingTab == 2) {//会议议程 校验
      form[formKey].validateForm().then(f => {
        if(f.isValid) {
          if(type == 'create' || type == 'edit' || type == 'change'){
            if (this.refs.create && this.refs.create.wrappedInstance.refs.topicEdit && this.refs.create.wrappedInstance.refs.topicEdit.refs.edit.doRequiredCheck().pass) {
              this.chkMeeting(allCreateDatas, type, meetingId);
            }else{
              dialogStatus.submitLoading = false;
              dialogStatus.saveLoading = false;
              if(this.refs.create && this.refs.create.wrappedInstance.refs.topicEdit){
                message.error(`${getLabel(384010, '存在必填项未填写')}`);
              }     
            }
          } else if (this.refs.create && this.refs.create.wrappedInstance.refs.topicEdit && this.refs.create.wrappedInstance.refs.topicEdit.refs.edit.doRequiredCheck().pass) {
              if (!serviceViewActive && (type == 'draft' || type == 'submit') && meetingServiceDefaultValue == 1) {
                dialogStatus.submitLoading = false;
                dialogStatus.saveLoading = false;
                changePreviewMeetingTab('3');
                message.error(`${getLabel(384010, '存在必填项未填写')}`);
              } else {
                this.chkMeeting(allCreateDatas, type, meetingId);
              }
            } else {
              if (type == 'draftSubmit') {
                this.chkMeeting(allCreateDatas, type, meetingId);
              }
              dialogStatus.submitLoading = false;
              dialogStatus.saveLoading = false;
              if(this.refs.create && this.refs.create.wrappedInstance.refs.topicEdit){
                message.error(`${getLabel(384010, '存在必填项未填写')}`);
              }  
            }
          } else {
          message.error(getLabel('507631','会议信息页面存在必填项未填写') )
          dialogStatus.submitLoading = false;
          dialogStatus.saveLoading = false;
        }
      })
    } else if (previewmeetingTab == 3) {//会议服务 校验
      form[formKey].validateForm().then(f => {
        if (f.isValid) {
          if(type == 'create' || type == 'edit' || type == 'change'){
            if (this.refs.create && this.refs.create.wrappedInstance.refs.serviceEdit && this.refs.create.wrappedInstance.refs.serviceEdit.refs.edit.doRequiredCheck().pass) {
              
            }else{
              dialogStatus.submitLoading = false;
              dialogStatus.saveLoading = false;
              if(this.refs.create && this.refs.create.wrappedInstance.refs.serviceEdit){
                message.error(`${getLabel(384010, '存在必填项未填写')}`);
              }  
            }
          } else if (this.refs.create && this.refs.create.wrappedInstance.refs.serviceEdit && this.refs.create.wrappedInstance.refs.serviceEdit.refs.edit.doRequiredCheck().pass) {
              if (!topicViewActive && (type == 'draft' || type == 'submit') && meetingTopicDefaultValue == 1) {
                dialogStatus.submitLoading = false;
                dialogStatus.saveLoading = false;
                changePreviewMeetingTab('2');
                message.error(`${getLabel(384010, '存在必填项未填写')}`);
              } else {
                this.chkMeeting(allCreateDatas, type, meetingId);
              }
            } else {
              if (type == 'draftSubmit') {
                this.chkMeeting(allCreateDatas, type, meetingId);
              }
              dialogStatus.submitLoading = false;
              dialogStatus.saveLoading = false;
              if(this.refs.create && this.refs.create.wrappedInstance.refs.serviceEdit){
                message.error(`${getLabel(384010, '存在必填项未填写')}`);
              }   
            }
          } else {
          message.error(getLabel('507631','会议信息页面存在必填项未填写') )
          dialogStatus.submitLoading = false;
          dialogStatus.saveLoading = false;
        }
      })
    } else {
      this.chkMeeting(allCreateDatas, type, meetingId);
    }
  }

  formValidate = (allCreateDatas, type, meetingId, callback) => {
    let { form, dialogStatus, changePreviewMeetingTab, serviceViewActive, topicViewActive, meetingTopicDefaultValue, meetingServiceDefaultValue } = this.props.meetingDialog;
    let key = meetingId == '' ? 'create' : meetingId;

    form[key].validateForm().then((f) => {
      if (f.isValid) {
        let checkTime = this.checkTime(allCreateDatas); //checkTime为true可以继续提交
        let {isInterval} = this.props;
        let checkRepeatTime = this.checkRepeatTime(allCreateDatas);
        let checkRemind = this.checkRemind(allCreateDatas,key);
        if (!checkTime) {
            errorModal({
              title: getLabel(15172, '系统提示'),
              content: getLabel(31832, '结束时间必须大于开始时间'),
              onOk:()=>{
                dialogStatus.submitLoading = false;
                dialogStatus.saveLoading = false;
              },
              onCancel:()=>{
                dialogStatus.submitLoading = false;
                dialogStatus.saveLoading = false;
              }
            })          
        } else if(!checkRemind){
          errorModal({
            title: getLabel(15172, '系统提示'),
            content: getLabel(83128, '请选择提醒时间'),
            onOk:()=>{
              dialogStatus.submitLoading = false;
              dialogStatus.saveLoading = false;
            },
            onCancel:()=>{
              dialogStatus.submitLoading = false;
              dialogStatus.saveLoading = false;
            }
          })
        }else if (isInterval && !checkRepeatTime) {
          errorModal({
            title: getLabel(15172, '系统提示'),
            content: getLabel(129693, '您提交的周期会议超出跨度限制，请联系管理员'),
            onOk:()=>{
              dialogStatus.submitLoading = false;
              dialogStatus.saveLoading = false;
            },
            onCancel:()=>{
              dialogStatus.submitLoading = false;
              dialogStatus.saveLoading = false;
            }
          })
        } else {
          let canSubmit = undefined; //为什么加这个参数，因为校验规则不支持动态修改。。。。。
          let content = getLabel(384434, '您还有必填项未填写');
          if (isInterval) {//周期会议
            canSubmit = allCreateDatas.address || allCreateDatas.customizeAddress;
            if (!canSubmit) {
              content = getLabel(384779, '会议地点、自定义会议地点，必须填写一个')
            };
            if(canSubmit){
              // canSubmit = allCreateDatas.hrmmembers || allCreateDatas.hrmDepartments || allCreateDatas.hrmSubCompanys;
              // if (!canSubmit) {
              //   content = getLabel(512362, '参会人员、参会部门、参会分部请至少选择1个！')
              // };
            }
            if (canSubmit && allCreateDatas.repeatType == 1) {//关于会议重复模式选择的必填校验
              canSubmit = allCreateDatas.repeatdays;
            } else if (canSubmit && allCreateDatas.repeatType == 2) {
              canSubmit = allCreateDatas.repeatweeks && allCreateDatas.rptWeekDays;
            } else if (canSubmit && allCreateDatas.repeatType == 3) {
              canSubmit = allCreateDatas.repeatmonths && allCreateDatas.repeatmonthdays;
            }
            if (canSubmit) {

            }
          } else {
            canSubmit = allCreateDatas.address || allCreateDatas.customizeAddress; //会议室和自定义会议室必须有一个填了内容
            if (!canSubmit) {
              content = getLabel(384779, '会议地点、自定义会议地点，必须填写一个')
            };
            if(canSubmit){
              // canSubmit = allCreateDatas.hrmmembers || allCreateDatas.hrmDepartments || allCreateDatas.hrmSubCompanys;
              // if (!canSubmit) {
              //   content = getLabel(512362, '参会人员、参会部门、参会分部请至少选择1个！')
              // };
            }
          }

          if (canSubmit) {
            if (callback && typeof(callback) == 'function') {//tab页切换校验成功，切换tab，不提交
              callback()
            } else {
              // 这里校验议程和服务，都通过，就走chekmeeting
              // 1、后端打开默认增加一行开关
              // 2、创建，编辑，变更情况下，校验。
                if (!topicViewActive && (type == 'draft' || type == 'submit') && meetingTopicDefaultValue == 1) {
                  dialogStatus.submitLoading = false;
                  dialogStatus.saveLoading = false;
                  changePreviewMeetingTab('2');
                  message.error(`${getLabel(384010, '存在必填项未填写')}`);
              } else if (!serviceViewActive && (type == 'draft' || type == 'submit') && meetingServiceDefaultValue == 1) {
                dialogStatus.submitLoading = false;
                dialogStatus.saveLoading = false;
                changePreviewMeetingTab('3');
                message.error(`${getLabel(384010, '存在必填项未填写')}`);
              } else {
                this.chkMeeting(allCreateDatas, type, meetingId);
              }
            }
          } else {
            errorModal({
              title: getLabel(15172, '系统提示'),
              content: content,
              onOk:()=>{
                dialogStatus.submitLoading = false;
                dialogStatus.saveLoading = false;
              },
              onCancel:()=>{
                dialogStatus.submitLoading = false;
                dialogStatus.saveLoading = false;
              }
            })
          }
        }
      } else {
        dialogStatus.submitLoading = false;
        dialogStatus.saveLoading = false;
        f.showErrors()
      }
    })
  }

  checkTime = (allCreateDatas) => {
    let {begindate, enddate, begintime, endtime,repeatbegindate,repeatenddate} = allCreateDatas;
    let {isInterval} = this.props;
    if(isInterval){
      if (repeatbegindate > repeatenddate) {
        return false;
      }else if(begintime >= endtime){
        return false;
      }else{
        return true;
      }
    }else{
      if (begindate > enddate) {
        return false;
      } else if (begindate == enddate && begintime >= endtime) {
        return false;
      } else {
        return true;
      }
    }

  }

  checkRepeatTime = (allCreateDatas) => {
    let {repeatenddate, maxRepeatDate} = allCreateDatas;
    if (maxRepeatDate != '' && repeatenddate > maxRepeatDate) {
      return false;
    } else {
      return true;
    }
  }

  checkRemind = (allCreateDatas,key) => {
    let {getFormBrowserType} = this.props.meetingDialog;
    if(getFormBrowserType('remindTypeNew',key) == 'INPUT'){
      return true;
    }
    let {remindTypeNew, remindImmediately,remindBeforeEnd,remindBeforeStart} = allCreateDatas;
    if (remindTypeNew && remindTypeNew != '' && 
      (remindImmediately === '0' || !remindImmediately) && 
      (remindBeforeEnd === '0' || !remindBeforeEnd) && 
      (remindBeforeStart ==='0' || !remindBeforeStart)) {
      return false;
    } else {
      return true;
    }
  }

}

//打开附件
window.openMeetingDiscussDoc = (t, showid, meetingid) => {
  openFullWindowHaveBar(`/spa/document/index2file.jsp?id=${showid}&isOpenFirstAss=1&meetingid=${meetingid}`)
}
//打开附件
window.openMeetingDiscussDownload = (t, showid, meetingid) => {
  window.open(`/weaver/weaver.file.FileDownload?fileid=${showid}&download=1&meetingid=${meetingid}`)
}

window.openMeetingAppLink = (linkType, linkid, meetingid) => {
  let {dialogStatus:{isPro}} = this.props.meetingDialog;
  if (linkType == 'doc')
    window.open(`/spa/document/index.jsp?id=${linkid}&meetingid=${meetingid}`)
  else if (linkType == 'task')
    window.open(`/spa/prj/index.html#/main/prj/taskCard?taskid=${linkid}`)
  else if (linkType == 'crm')
    window.open(isPro?`/CRM/manage/customer/CustomerBaseView.jsp?CustomerID=${linkid}`:`/spa/crm/static/index.html#/main/crm/customerView?customerId=${linkid}`)
  else if (linkType == 'workflow')
    window.open(`/spa/workflow/static4form/index.html#/main/workflow/req?fromModul=meeting&modulResourceId=${meetingid}&requestid=${linkid}`)
  else if (linkType == 'project')
    window.open(`/spa/prj/index.html#/main/prj/projectCard?prjid=${linkid}`)
  else
    return false
}

export default MeetingDialog
